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

[Helm plugin] Changed repo secrets copied now to Kubeapps namespace #5183

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

castelblanque
Copy link
Collaborator

Signed-off-by: Rafa Castelblanque rcastelblanq@vmware.com

Description of the change

With the introduction of #5140, the secret for namespaced repos was being copied to the global namespace, which is incorrect.
The right one is the kubeapps namespace. Both are equal by default, but when apprepository.globalReposNamespaceSuffix is specified, syncer job runs in kubeapps namespace, and secrets are being created in the global namespace. This leads the syncer job creation to fail with error: Error: secret "test-apprepo-example-repo" not found.

This PR changes logic when creating and updating package repos so that secrets are copied to the kubeapps namespace if repo wasn't created in that namespace. In this way, we make sure that asset syncer has the secret available.

Benefits

Namespaced repos can be synced correctly now.

Possible drawbacks

We need to differentiate between global repos (in the Kubeapps global namespace, e.g. kubeapps-repos-global) and repos in kubeapps namespace (which might not be global).

Applicable issues

Additional information

This bug was found to be the origin of the problem mentioned in this comment of 5115.

Rafa Castelblanque added 2 commits August 9, 2022 12:49
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@netlify
Copy link

netlify bot commented Aug 9, 2022

Deploy Preview for kubeapps-dev canceled.

Name Link
🔨 Latest commit 69597cd
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/62f24be24a0651000872ce53

Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

Great!! Thanks for catching the error and finding a solution. Just a question: what would happen when updating a repo? Is the secret also being updated in the kubeapps ns?

@castelblanque
Copy link
Collaborator Author

what would happen when updating a repo? Is the secret also being updated in the kubeapps ns?

Yes, secret will be created/overwritten with the new one, if any. You can see it here.

@castelblanque castelblanque merged commit 08f7f2e into main Aug 9, 2022
@castelblanque castelblanque deleted the 5129--global-secrets-kubeapps branch August 9, 2022 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repos API/Helm - Support global private repos
3 participants