I'm getting a weird error trying to transform a YA...
# general
r
I'm getting a weird error trying to transform a YAML file
Copy code
kubernetes:<http://rbac.authorization.k8s.io:ClusterRoleBinding|rbac.authorization.k8s.io:ClusterRoleBinding> (argo-binding):
    error: Failed to check for changes in resource /argo-binding because of an error computing the JSON patch describing the resource changes: unrecognized type: string
Relevant code:
Copy code
// Create resources for Argo from its YAML manifests
const argo = new k8s.yaml.ConfigFile("argo",
    {
        file: "<https://raw.githubusercontent.com/argoproj/argo/stable/manifests/install.yaml>",
        transformations: [
            (obj: any) => {
                // Convert `argo` to the unique namespace generated above
                if (obj.kind == "ClusterRoleBinding") {
                    obj.subjects[0].namespace = argoNamespace.apply(val => `${val.toString()}`)
                    console.log(obj)
                }
            }
        ],
    },
    {
        providers: { "kubernetes": mainCluster.provider },
    },
);
Debug output
Copy code
{
      apiVersion: '<http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>',
      kind: 'ClusterRoleBinding',
      metadata: { name: 'argo-binding' },
      roleRef: {
        apiGroup: '<http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>',
        kind: 'ClusterRole',
        name: 'argo-cluster-role'
      },
      subjects: [ { kind: 'ServiceAccount', name: 'argo', namespace: [OutputImpl] } ]
    }
Note, using
${val}
instead of toString yields the same error
m
r
Ah okay, is there a workaround in the meantime?
m
I think that downgrading to an earlier provider should fix this. Sorry for the trouble here!
g
r
Thanks!