better-shampoo-48884
06/02/2021, 9:48 AMk8s.yaml.ConfigFile/ConfigGroup
apply the resources to a namespace? I don't want to muck with the files, and they don't have a namespace declared in the yaml, so the transformation I've got seems to fail..
For instance:
const keyCloakAccounts = new k8s.yaml.ConfigGroup("keycloak-roles-accounts-bindings", {
files: [
`${pathToKeyCloakOper}/role.yaml`,
`${pathToKeyCloakOper}/role_binding.yaml`,
`${pathToKeyCloakOper}/service_account.yaml`
],
transformations: [
(obj: any, opts: pulumi.CustomResourceOptions) => {
obj.meta.namespace = keyCloakNamespace.metadata.name;
}
]
},{
provider: args.providers.kubernetes,
parent: this,
dependsOn: keyCloakNamespace
})
Which fails with:
TypeError: Cannot set property 'namespace' of undefined
at Foundation.k8s.yaml.ConfigGroup.transformations (<path>\pulumi\baseline-k8s\components\kubernetes-components\foundation.ts:128:44)
at parseYamlObject (<path>\pulumi\baseline-k8s\node_modules\@pulumi\yaml\yaml.ts:2925:9)
at <path>\pulumi\baseline-k8s\node_modules\@pulumi\yaml\yaml.ts:2903:25
at Array.map (<anonymous>)
at <path>\pulumi\baseline-k8s\node_modules\@pulumi\yaml\yaml.ts:2903:14
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
gorgeous-egg-16927
06/02/2021, 2:53 PM