openebs-archive / maya

Manage Container Attached Storage (CAS) - Data Engines in Kubernetes
https://docs.openebs.io
Apache License 2.0
184 stars 201 forks source link

"admission-webhook.openebs.io" does not support dry run #1771

Closed mpartel closed 3 years ago

mpartel commented 4 years ago

Description

When running kubectl diff or kubectl apply --dry-run on a config that defines a PersistentVolumeClaim, I get this error: admission webhook "admission-webhook.openebs.io" does not support dry run

Possible Solution

You can mark the ValidatingWebhook resource that OpenEBS installs in webhook/configuration.go as sideEffects: None or NoneOnDryRun, assuming the webhook indeed has no side-effects.

I can make a PR if that helps, but I'd prefer if a dev could tell me whether the webhook has no side-effects rather than reading through all that the code myself.

mpartel commented 4 years ago

Workaround: since maya doesn't overwrite the config if it exists, and since it appears there are no side-effects, it seems safe to modify the config after it appears.

prateekpandey14 commented 3 years ago

@mpartel i have tried to run the --dry-run command, but not getting any error, can you share the k8s version you are trying ?

$ kubectl apply --dry-run -f cstor-pvc.yaml
persistentvolumeclaim/cstor-test created (dry run)

Workaround: since maya doesn't overwrite the config if it exists, and since it appears there are no side-effects, it seems safe to modify the config after it appears.

Yes , there is no side-effects.

mpartel commented 3 years ago

It was either 1.19.3 or 1.19.4

prateekpandey14 commented 3 years ago

Ok , i think you already tried by setting the SideEffects: None and it should work fine. I am going to raise a PR with that change anyways. thanks

mpartel commented 3 years ago

Yeah, I've seen no problems having set that manually :+1: Thanks!