-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support setting namespace for every deployer #852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f41a3bb
to
21d3dd8
Compare
7ef1c2c
to
b82c2f0
Compare
7c71ad4
to
7f25aa5
Compare
pkg/skaffold/deploy/kustomize.go
Outdated
@@ -107,3 +109,22 @@ func buildManifests(kustomization string) (io.Reader, error) { | |||
} | |||
return bytes.NewReader(out), nil | |||
} | |||
|
|||
// TODO(dgageot): this code is already in KubectlDeployer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why wouldn't we just add the namespace parameter to the kubectl method which we would leave as a package level utility? I'm not sure I follow why both the kustomizeDeployer and the KubeCtlDeployer need kubectl command. What is your plan here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have a plan. The thing is that both deployer deploy with kubectl
. I wanted to embed KubeCtlDeployer
into kustomizeDeployer
but I'm not sure it's really better than a little duplication.
Another plan would be to extract this function and the state it requires into a shared package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted the kubectl CLI code to a separate package to make easier to share between both deployers.
ns, err := client.CoreV1().Namespaces().Create(&v1.Namespace{ | ||
ObjectMeta: meta_v1.ObjectMeta{ | ||
Name: namespaceName, | ||
Namespace: namespaceName, | ||
GenerateName: "skaffold", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
}, | ||
{ | ||
description: "helm example", | ||
args: []string{"run"}, | ||
deployments: []testObject{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for the yagni cleanup.
996c4b1
to
4f79a65
Compare
via flag or env variable. Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Support setting namespace for every deployer via
--namespace
flag orSKAFFOLD_NAMESPACE
env variable.Also :