worried-city-86458
09/17/2019, 6:34 PMcool-egg-852
09/17/2019, 6:35 PMworried-city-86458
09/17/2019, 6:35 PMpulumi up
cool-egg-852
09/20/2019, 5:06 PMworried-city-86458
09/20/2019, 7:41 PMk8s.yaml.ConfigFile
with pre-existing yaml.white-balloon-205
transforms
on the ConfigFile
to rewrite the dependency between the two.worried-city-86458
09/20/2019, 8:04 PMwhite-balloon-205
worried-city-86458
09/21/2019, 10:43 PMtransforms
to rewrite the dependency between the daemonset and configmap.let configMap: any;
function setParent(obj: any, opts: pulumi.CustomResourceOptions) {
if (obj.kind == "ConfigMap") {
configMap = obj;
}
else if (obj.kind == "DaemonSet") {
opts.parent = configMap;
}
}
const fluentBit = new k8s.yaml.ConfigFile("fluent-bit.yml", { transformations: [ setParent ] }, { parent: cluster, provider: cluster.provider });
Diagnostics:
pulumi:pulumi:Stack (k8s-infra-dev):
error: Running program '/workspaces/workspace/k8s-infra' failed with an unhandled exception:
Error: Resource parent is not a valid Resource: [object Object]
at new Resource (/workspaces/workspace/k8s-infra/node_modules/@pulumi/pulumi/resource.js:92:19)
at new CustomResource (/workspaces/workspace/k8s-infra/node_modules/@pulumi/pulumi/resource.js:265:9)
at new DaemonSet (/workspaces/workspace/k8s-infra/node_modules/@pulumi/kubernetes/apps/v1/DaemonSet.js:31:9)
at /workspaces/workspace/k8s-infra/node_modules/@pulumi/kubernetes/yaml/yaml.js:395:31
at OutputImpl.<anonymous> (/workspaces/workspace/k8s-infra/node_modules/@pulumi/pulumi/output.js:110:47)
at Generator.next (<anonymous>)
at fulfilled (/workspaces/workspace/k8s-infra/node_modules/@pulumi/pulumi/output.js:18:58)
transformations
are called on the raw object, before it's instantiated as a `pulumi.Resource`:
https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/nodejs/yaml/yaml.ts#L2569
https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/nodejs/yaml/yaml.ts#L2587