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

Support dryRun for POST, PUT, PATCH, and DELETE #412

Open
rhysm opened this issue May 7, 2019 · 3 comments
Open

Support dryRun for POST, PUT, PATCH, and DELETE #412

rhysm opened this issue May 7, 2019 · 3 comments

Comments

@rhysm
Copy link
Contributor

rhysm commented May 7, 2019

Dry Run is now available as beta since Kubernetes v1.13.

This involves adding the dryRun query parameter to requests. I'm hesitant to jump in and add support for extra parameters to the various modifier _entity methods as I see some discussion around cleaning these up in #312.

I'm thinking #391 with the addition of the **opts to create_ and update_ will allow us to easily add a dryRun option to those methods.

@cben
Copy link
Collaborator

cben commented May 8, 2019

Nice. Do you know what happens if you send dryRun param to older k8s that doesn't understand it? Does it error or silently performs a wet run 😰? Is there a way to detect dry run support?

@abonas
Copy link
Member

abonas commented May 8, 2019

Nice. Do you know what happens if you send dryRun param to older k8s that doesn't understand it? Does it error or silently performs a wet run? Is there a way to detect dry run support?

It seems that any feature in alpha/beta can be switched on/off via feature gates (aka feature flags)
https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
So you might run into a situation with older versions which lack support, but also even on a version where dryRun is present, but is disabled.
AFAIK there's no way to query upfront on the list and status of feature gates, but perhaps @rhysm knows a way?

@rhysm
Copy link
Contributor Author

rhysm commented May 8, 2019

@cben I don't have access to an older cluster right now. I have a branch https://github.com/rhysm/kubeclient/tree/dryRun which I've been using for testing if someone has one readily available. Otherwise I can get one running in the next few days and give it a try.

@abonas I don't know any way of determining via the API if feature gates are enabled.

I think we would have to document the option clearly to ensure users understand their cluster needs the dry run feature enabled for this to work. We could also name the option serverSideDryRun to be really explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants