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

⚠️ Add Server-Side DryRun support to Client #338

Merged
merged 6 commits into from
Mar 14, 2019

Conversation

JoelSpeed
Copy link
Contributor

This PR adds CreateOptions and UpdateOptions to the Client package to allow client users to set the DryRun option when creating and updating resources using the client. This should allow users to see the result of all Admission controllers before persisting changes.

I've attempted to match the patterns in DeleteOptions and ListOptions as much as possible but since the only valid value for DryRun is all (see here) I've not made that configurable, but it could be easily changed. I've also had to name the two OptionFuncs CreateDryRunAll and UpdateDryRunAll which I don't particularly like, has anyway any better ideas for names for these?

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 26, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 26, 2019
@JoelSpeed
Copy link
Contributor Author

/assign @droot

Copy link
Contributor

@DirectXMan12 DirectXMan12 left a comment

Choose a reason for hiding this comment

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

you missed fakeClient, otherwise LGTM 👍

@JoelSpeed
Copy link
Contributor Author

@DirectXMan12 I've updated the fake client to basically do a no-op when passed the DryRunAll options, do you think that is sufficient?

@DirectXMan12
Copy link
Contributor

yeah, I think that's sufficient. Looks like travis is complaining about 2 tests.

@JoelSpeed
Copy link
Contributor Author

Looks like travis is complaining about 2 tests.

I think this is because the K8s version being used in the tests is 1.10.1 which I guess silently ignores the DryRun option, am I ok to update this to a newer version?

header_text "fetching tools"
kb_tools_archive_name="kubebuilder-tools-$k8s_version-$goos-$goarch.tar.gz"
kb_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name"

@DirectXMan12
Copy link
Contributor

Yeah, go ahead and update to a newer version :-)

@DirectXMan12
Copy link
Contributor

1.13.1 is the latest, IIRC. I've turned on listing on that bucket, so you should be able to check yourself now.

@JoelSpeed
Copy link
Contributor Author

@DirectXMan12 I've bumped the K8s version and the tests are passing now

@DirectXMan12
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 14, 2019
@DirectXMan12
Copy link
Contributor

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2019
@DirectXMan12 DirectXMan12 changed the title ✨ Add Server-Side DryRun support to Client ⚠️ Add Server-Side DryRun support to Client Mar 14, 2019
@DirectXMan12
Copy link
Contributor

technically this is breaking, since it changes an interface -- needed to update title

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2019
@k8s-ci-robot k8s-ci-robot merged commit 276610b into kubernetes-sigs:master Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants