hi there, i'm facing an issue with a very straight...
# dotnet
m
hi there, i'm facing an issue with a very straight forward objective: to pull a Pulumi.Kubernetes HPA
MetricSpecArgs
object from Pulumi Config. Here's my stack yaml:
Copy code
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:
Copy 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
Copy code
============== Get MetricSpecArgs via Config.GetObject ==============
    args: {"ContainerResource":null,"External":null,"Object":null,"Pods":null,"Resource":null,"Type":null}
    args.Type: