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

Installing as a subchart fails on the second installation because of hardcoded webhook name #443

Open
heruan opened this issue Nov 7, 2024 · 1 comment

Comments

@heruan
Copy link

heruan commented Nov 7, 2024

Having CNPG as a subchart, i.e.

dependencies:
  - name: cloudnative-pg
    version: ~0.22.0
    repository: https://cloudnative-pg.github.io/charts

if fails with this error when installing the chart a second time with a different release name:

$ helm install foo ./umbrella-chart -ns foo
$ helm install bar ./umbrella-chart -ns bar

Error: INSTALLATION FAILED: Unable to continue with install: MutatingWebhookConfiguration "cnpg-mutating-webhook-configuration"
in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error:
key "meta.helm.sh/release-name" must equal "bar": current value is "foo"; annotation validation error:
key "meta.helm.sh/release-namespace" must equal "bar": current value is "foo"

This would be fixed if the name of the webhook would be prefixed by the release name instead of being hardcoded in

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: cnpg-mutating-webhook-configuration

as it happens for example for CertManager webhooks.

@heruan
Copy link
Author

heruan commented Nov 7, 2024

Same for the validating webhook:

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: cnpg-validating-webhook-configuration

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

No branches or pull requests

1 participant