modern-boots-64313
04/29/2024, 8:52 AMMetricSpecArgs
object from Pulumi Config.
Here's my stack yaml:
Workloads:hpa-metrics:
type: "Resource"
resource:
name: "cpu"
target:
type: "Utilization"
averageUtilization: 50
I'm hoping my stack is able to read from config yaml using GetObject
method into the type and use it directly but it doesn't work
Here's my code:
Console.WriteLine($"============== Get MetricSpecArgs via Config.GetObject ==============");
var args = Config.GetObject<MetricSpecArgs>("hpa-metrics");
Console.WriteLine($"args: {System.Text.Json.JsonSerializer.Serialize(args)}");
Console.WriteLine($"args.Type: {args.Type}");
and here's the console output to prove the values are not deserialized, all are just null
============== Get MetricSpecArgs via Config.GetObject ==============
args: {"ContainerResource":null,"External":null,"Object":null,"Pods":null,"Resource":null,"Type":null}
args.Type: