Skip to content
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

allow to skip namespace creation #203

Closed
wants to merge 1 commit into from
Closed

allow to skip namespace creation #203

wants to merge 1 commit into from

Conversation

torstenwalter
Copy link
Contributor

What this PR does / why we need it:

In some environments it's not reasonable to allow creation and deletion of namespaces. This flag allows to use chart testing with already existing namespaces.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

It's missing tests. Just want to get feedback if this would be a useful addition.

In some environments it's not reasonable to allow creation and deletion
of namespaces. This flag allows to use chart testing with already
existing namespaces.

Signed-off-by: Torsten Walter <[email protected]>
@@ -541,8 +541,10 @@ func (t *Testing) doInstall(chart *Chart) error {
namespace, release, releaseSelector, cleanup := t.generateInstallConfig(chart)
defer cleanup()

if err := t.kubectl.CreateNamespace(namespace); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if adding a check to see if the namespace already exists before creation would handle your use case without adding a new flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be an option, too. In that case it should not try to delete the namepace at the end.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually if I remember correctly "do not create or delete namespace" was exactly the intended behavior of #59. If passing the namespace flag can currently cause an existing namespace to be deleted I view that as a bug to be patched.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. This should already be supported. I'll have to look into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unguiculus Thank you for looking into it. In the source code it looks like as if this feature has been removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A regression was introduced due to Helm 3 no longer creating namespaces. This caused namespaces to always be created. #205 fixes this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks fo looking into it. I am closing this in favor of your PR.

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

Successfully merging this pull request may close these issues.

4 participants