-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Applied namespace to Cleanup and getArgs #3787
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
@nkubala Here is the PR for the Helm 3 namespace issue. Some pointers on where to figure out the unit/integration testing would be appreciated! |
Codecov Report
|
@BlenderDude thanks for the PR! func makeRunContext(deploy latest.HelmDeploy, force bool, namespace string) *runcontext.RunContext {
pipeline := latest.Pipeline{}
pipeline.Deploy.DeployType.HelmDeploy = &deploy
ns := testNamespace
if namespace != "" {
ns = namespace
}
return &runcontext.RunContext{
Cfg: pipeline,
KubeContext: testKubeContext,
Opts: config.SkaffoldOptions{
Namespace: ns,
KubeConfig: testKubeConfig,
Force: force,
},
}
} don't worry about integration tests for now. we're only testing helm 2 at the moment, I'm gonna need to make a bigger change to add support for helm 3 as well. |
@nkubala Sounds good, I'll get those implemented. |
@nkubala I have gotten the tests merged in. I added a new deploy config which includes a namespace to test against. These tests should have everything covered! |
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.
@BlenderDude nice job, and thanks for the fix!
Description
Fixes #3762
This PR changes how the namespace applied in the release in the
skaffold.yaml
file is sent to Helm 3. It currently does not look for helm releases in the defined namespace, this PR applies the--namespace
parameter to the helm calls, but only for Helm 3.User facing changes
With Helm 3 supporting fully namespace'd releases, it would be expected that setting the namespace in the Skaffold release would make it deploy there. Currently this is only the case for the deployment step. For cleanup and getting the current lists of deployments, it does not apply the namespace.
Before
Skaffold would successfully push the first version of the Helm release successfully. When tearing down, it would fail because the
delete
command did not have the namespace sent to it with the--namespace
argument. When running Skaffold again, the un-deleted release would still exist, but it would not pick up on it because the function that gets the current releases did not apply the namespace properly either.After
The normal workflow for skaffold is properly executed. Skaffold accesses the current helm releases in the namespace defined in the
skaffold.yaml
file. If it does not exist, it deploys to the namespace, or upgrades if it does. When tearing down, it properly deletes the release from the namespace.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Reviewer Notes
Release Notes
This was a bug noticed before support for helm 3 was published, so I'm not sure anything needs to be added here.