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

Allows the release namespace to be overridden #909

Merged
merged 8 commits into from
Jul 4, 2023

Conversation

KhizerJaan
Copy link
Contributor

@KhizerJaan KhizerJaan commented Jun 11, 2023

Problem:

  • Vault can only be deployed in Release namespace.

Root Cause:

  • namespace is hardcoded to {{ .Release.Namespace }}

Solution:

  • Templatize namespaec in _helpers.tpl

@KhizerJaan KhizerJaan requested a review from a team June 11, 2023 20:58
@hashicorp-cla
Copy link

hashicorp-cla commented Jun 11, 2023

CLA assistant check
All committers have signed the CLA.

@tomhjp
Copy link
Contributor

tomhjp commented Jun 14, 2023

Hi @KhizerJaan, thanks for your interest and PR! Please could you provide some more context about why this is useful?

@KhizerJaan
Copy link
Contributor Author

KhizerJaan commented Jun 14, 2023

Hello @tomhjp , If Vault Helm Chart is being used as dependency in another helm (umbrella) chart, it is deployed to umbrella chart release namespace . This PR would enabled to override namespace for Vault Helm Chart.

@KhizerJaan
Copy link
Contributor Author

KhizerJaan commented Jun 14, 2023

@tomhjp kindly review and merge the pull request at your convenience. I have umbrella chart use case and am blocked by it . default namespace is set to Release.Namespace , so it won't effect current behavior and would add an extra feature.
By allowing users to choose the deployment namespace, Helm charts become more versatile and adaptable to different environments and deployment strategies. Users can deploy the chart in the namespace that aligns with their specific requirements or organizational practices .

@tomhjp
Copy link
Contributor

tomhjp commented Jun 19, 2023

Thanks for the explanation, that makes sense. This seems like a nice improvement to merge then with a few additions. Please could we add some bats unit tests for each resource, a default empty value in the Values file, an entry in the schema, and a short changelog entry under unreleased improvements? Happy to help out with any of those, just let me know if you need some pointers or assistance.

@KhizerJaan
Copy link
Contributor Author

Sure. Highly appreciate the feedback and suggestions @tomhjp . I will incorporate the suggested changes, and submit a revised version that addresses the feedback provided.

@KhizerJaan
Copy link
Contributor Author

@tomhjp I have incorporated the suggestions provided.
Kindly review the updated PR at your convenience. I believe that it is now complete and addresses all the necessary improvements. However, I welcome any further feedback or suggestions you may have to enhance the quality of the contribution.

@KhizerJaan
Copy link
Contributor Author

@tomhjp Could you please consider merging this PR? Alternatively, I would greatly appreciate any feedback you might have.

Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Thanks for the changes so far - just a few more small suggestions and then I think this is ready to merge.

values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
test/unit/csi-agent-configmap.bats Show resolved Hide resolved
@tomhjp
Copy link
Contributor

tomhjp commented Jun 26, 2023

I ran the CI and a few unit test failures came up FYI. Judging from the test names, looks like they should be trivial fixes.

not ok 166 injector/certs-secret: namespace is set in 131ms
not ok 168 injector/role: namespace is set in 130ms
not ok 170 injector/rolebinding: namespace is set in 135ms
not ok 174 injector/MutatingWebhookConfiguration: namespace is set in 138ms

@KhizerJaan
Copy link
Contributor Author

@tomhjp Thank you for suggestions . highly appreciate it . I've updated regards to your suggestions . PTAL

@KhizerJaan
Copy link
Contributor Author

@tomhjp PTAL

@KhizerJaan
Copy link
Contributor Author

@tomhjp can this be merged please.

Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Sorry, the changelog changed in main since my last review - please could you rebase/merge in main to make sure the changes stay in the unreleased section when this is merged? Otherwise LGTM

values.yaml Outdated Show resolved Hide resolved
KhizerJaan and others added 2 commits June 29, 2023 00:44
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
@KhizerJaan
Copy link
Contributor Author

@tomhjp branch synced . PTAL

@KhizerJaan
Copy link
Contributor Author

KhizerJaan commented Jul 4, 2023

@tomhjp can you please merge this PR? I've synced with main . or it would be great if you have any feedback.

@tomhjp
Copy link
Contributor

tomhjp commented Jul 4, 2023

I've just run the tests again to prepare for merging, but it looks like the same ones from before are still failing. Do you need some help getting going with running them locally?

not ok 166 injector/certs-secret: namespace is set
not ok 168 injector/role: namespace is set
not ok 170 injector/rolebinding: namespace is set
not ok 174 injector/MutatingWebhookConfiguration: namespace is set

@KhizerJaan
Copy link
Contributor Author

@tomhjp previously results were escaped like this \"bar\" and it was failing locally so i removed escaping characters . now I've reverted back to escaping . can you please test now?

@tomhjp
Copy link
Contributor

tomhjp commented Jul 4, 2023

Looks like that's done the trick, thanks. The other way to fix it would be to add -r to the yq command, like yq -r '.webhooks[0].clientConfig.service.namespace', but what you've got now LGTM.

amir-badar added a commit to amir-badar/vault-helm that referenced this pull request Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants