Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Can't set deployment namespace with simple ".withNamespace" mixin #92

Open
fabioy opened this issue Nov 30, 2017 · 1 comment
Open

Can't set deployment namespace with simple ".withNamespace" mixin #92

fabioy opened this issue Nov 30, 2017 · 1 comment

Comments

@fabioy
Copy link

fabioy commented Nov 30, 2017

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");

@askreet
Copy link

askreet commented Aug 10, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants