<@UCFNE2370> I've been messing with your Immutable...
# dotnet
b
@worried-city-86458 I've been messing with your ImmutableExtensions and wondering, what
(string)resource["kind"] == kind
does? Thanks.
w
It's just a way to easily filter the kind (type) of k8s resource to transform; e.g.:
Copy code
new ConfigFile($"{prefix}-ingress",
    new ConfigFileArgs
    {
        File = "ingress-controller.yml",
        Transformations =
        {
            (obj, opts) => obj.Mutate("Deployment", deployment =>
            {
                var args = (List<object>)deployment.spec.template.spec.containers[0].args;
                args.AddRange(new[] { $"--aws-region={config.AwsRegion}", $"--cluster-name={name}" });
            })
        }
    },
    new ComponentResourceOptions { Provider = Provider });
To transform the k8s deployment resource
While I appreciate the intention of the immutable types, the dev experience sucks. 😞
b
Got it, thanks. Yeah, I agree, your extensions help with that though. 🙂
w
I recommend using kube2pulumi instead, which gives much more control, but might not be practicable for large yaml files while tracking upstream changes, depending on how much you tweak the resulting c# to your liking. 😉
👍 1