https://pulumi.com logo
#general
Title
# general
r

ripe-dinner-40604

08/01/2019, 8:46 PM
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

microscopic-florist-22719

08/01/2019, 8:54 PM
r

ripe-dinner-40604

08/01/2019, 8:55 PM
Ah okay, is there a workaround in the meantime?
m

microscopic-florist-22719

08/01/2019, 9:19 PM
I think that downgrading to an earlier provider should fix this. Sorry for the trouble here!
g

gorgeous-egg-16927

08/02/2019, 3:14 AM
r

ripe-dinner-40604

08/02/2019, 9:18 PM
Thanks!
2 Views