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

Update dry-run KEP with kubectl plan #1399

Merged
merged 7 commits into from
Dec 13, 2019

Conversation

julianvmodesto
Copy link
Contributor

For server-side dry-run GA, we want to support --dry-run=server.

This change updates the KEP to describe this plan, as discussed in kubernetes/kubernetes#85652

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 9, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @julianvmodesto. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Dec 9, 2019
@julianvmodesto
Copy link
Contributor Author

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Dec 9, 2019
@julianvmodesto
Copy link
Contributor Author

julianvmodesto commented Dec 9, 2019

@julianvmodesto
Copy link
Contributor Author

Oh, for backwards compatibility, we need to both support --dry-run=true and --dry-run=false. So we need --dry-run=client, --dry-run=server, and --dry-run=none, where --dry-run=true is equivalent to --dry-run=client, and --dry-run=false is equivalent to --dry-run=none.

@julianvmodesto
Copy link
Contributor Author

Starting a WIP here: kubernetes/kubernetes#86143

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Nits, but this lgtm.

keps/sig-api-machinery/0015-dry-run.md Outdated Show resolved Hide resolved
keps/sig-api-machinery/0015-dry-run.md Show resolved Hide resolved
the `dryRun` query parameter by reading the user's intent from a flag.

For beta, we use `--server-dry-run` for `kubectl apply` to exercise
server-side apply. This flag will be deprecated next release, then removed in 2 releases.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this was beta, you can remove this in one release, honestly (compare https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, updated

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 12, 2019
@apelisse
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2019
@apelisse
Copy link
Member

The KEP lives in sig-apimachinery, since it's mostly an api-machinery feature (even though this specific change is CLI related). I'll ask someone to approve since Maciej already approved.

`none`.

For backwards compatibility, we'll continue to default the value for `--dry-run`
to `--dry-run=client`, which is equivalent to the existing behavior for
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think is the place where you want to end up. I expected the command to eventually have --dry-run mean "server-side dry run". How would you manage the transition of the default?

Copy link
Contributor Author

@julianvmodesto julianvmodesto Dec 12, 2019

Choose a reason for hiding this comment

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

As a human user or in CI, the primary use case is to validate that kubectl apply --dry-run -f path/to/manifests works. We do want to change the default to --dry-run=server, and the expectation would not be broken for human users or CI with the new default.

I'll update the KEP to say we're introducing --dry-run=client for backward compatibility in this release (1.18), but will deprecate this option in 1 release after (1.19), and remove it in 3 releases (1.21)? Such that we end in a state where none and server are the only supported values in 3 releases (1.21), with --dry-run=server being the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apelisse mentioned you discussed ensuring the dry run flag is always explicitly set instead of implicitly defaulted.

Updated the KEP to deprecate the default unset flag behavior and require that the flag is always set in the future.

PTAL @deads2k @soltysh

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2019
@deads2k
Copy link
Contributor

deads2k commented Dec 13, 2019

As a human user or in CI, the primary use case is to validate that kubectl apply --dry-run -f path/to/manifests works. We do want to change the default to --dry-run=server, and the expectation would not be broken for human users or CI with the new default.

I'll update the KEP to say we're introducing --dry-run=client for backward compatibility in this release (1.18), but will deprecate this option in 1 release after (1.19), and remove it in 3 releases (1.21)? Such that we end in a state where none and server are the only supported values in 3 releases (1.21), with --dry-run=server being the default.

This plan ensures that users get a clear, breaking signal that the default they were using before is broken/gone and makes that pain happen all at once. It will be disruptive, but the alternative is silently changing behavior in ways that users aren't likely to notice until something bad happens. I think this is a reasonable way forward.

/approve
/assign @soltysh

@soltysh owns lgtm for CLI

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2019
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

👍 for the plan proposed.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, deads2k, julianvmodesto, soltysh

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 merged commit 542ed78 into kubernetes:master Dec 13, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 13, 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. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants