Open fabioy opened 6 years ago
AFAICT this is because scoped withX methods are used which change the mixins in the associated object. Seems to be a somewhat pervasive problem, though most easily seen in Deployment because of the nested nature of the objects. Essentially, the Deployment you get back is broken.
When using deployment object, somehow the mixins get confused, so the top level ".withNamespace" sets it for the pod template, and not the deployment:
Repro:
local appDeployment = deployment .new( "heptio-server", 4, serverContainer, params.labels) .withNamespace("heptio-svc");
Expected: deployment within given namespace.
Result: Sets the namespace in the pod spec.
Workaround:
The workaround is a bit hard to discover, but this works:
local appDeployment = deployment .new( "heptio-server", params.replicas, serverContainer, myparams.labels)+ deployment.mixin.metadata.withNamespace("heptio-svc");