kptdev / kpt

Automate Kubernetes Configuration Editing
https://kpt.dev
Apache License 2.0
1.7k stars 228 forks source link

`set-namespace` should not modify `CustomResourceDefinition` if `spec.conversion.strategy` is unset. #3837

Open yuwenma opened 1 year ago

yuwenma commented 1 year ago

Expected behavior

Run gcr.io/kpt-fn/set-namespace:unstable against CustomResourceDefinition resource, we expect the spec.conversion.webhook.clientConfig.service.namespace to only be updated if the conversion.strategy is "webhook" (required)

Actual behavior

No matter what the strategy is, set-ns always update the webhook.clientConfig.service.namespace

johnbelamaric commented 1 year ago

Isn't this a duplicate of https://github.com/GoogleContainerTools/kpt/issues/3560 ? (which should say set-namespace in the title, which may be why it got duped...)

yuwenma commented 1 year ago

Isn't this a duplicate of #3560 ? (which should say set-namespace in the title, which may be why it got duped...)

Ah, Yes! I was in the impression of seeing such a bug report but really can't find it so I decide to file it myself.

shashidhar-patil commented 7 months ago

Is there a fix for it ?