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 dry-run flag to auth reconcile #64458

Merged
merged 1 commit into from May 30, 2018

Conversation

@mrogers950
Copy link
Contributor

mrogers950 commented May 29, 2018

The --dry-run flag has been enabled for kubectl auth reconcile

/assign @juanvallejo
cc @enj

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

/assign @deads2k

See if you agree with the flag names.

@mrogers950 probably need to update completions.

@@ -87,6 +90,9 @@ func NewCmdReconcile(f cmdutil.Factory, streams genericclioptions.IOStreams) *co
o.PrintFlags.AddFlags(cmd)

cmdutil.AddFilenameOptionFlags(cmd, o.FilenameOptions, "identifying the resource to reconcile.")
cmd.Flags().BoolVar(&o.DryRun, "dry-run", false, "If true, display results but do not submit changes")

This comment has been minimized.

@enj

enj May 29, 2018

Member

I am wondering if printing needs to account for this somehow.

This comment has been minimized.

@deads2k

deads2k May 29, 2018

Contributor

I am wondering if printing needs to account for this somehow.

I don't think that printers have dry run as a first level option. This the the domain of the command which is controlling behavior. The only printing side-effect is the name printer string which is already configurable.

@juanvallejo and @soltysh since we already litigated this once.

This comment has been minimized.

@soltysh

soltysh May 30, 2018

Contributor

Yup, we've agreed that printers don't have to do anything with dry-run, it's command specific.

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

/ok-to-test

@mrogers950 mrogers950 force-pushed the mrogers950:reconcile-dryrun-additive branch from 9087305 to 64a387c May 29, 2018

@mrogers950

This comment has been minimized.

Copy link
Contributor Author

mrogers950 commented May 29, 2018

@enj updated to account for a dry run printout

@mrogers950 mrogers950 force-pushed the mrogers950:reconcile-dryrun-additive branch 2 times, most recently from 60c3209 to dc342ef May 29, 2018

@mrogers950 mrogers950 changed the title Add dry-run and additive-only flags to auth reconcile Add dry-run flag to auth reconcile May 29, 2018

@mrogers950

This comment has been minimized.

Copy link
Contributor Author

mrogers950 commented May 29, 2018

@enj @deads2k dropped additive-only from this for now

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

/lgtm

@@ -87,6 +89,7 @@ func NewCmdReconcile(f cmdutil.Factory, streams genericclioptions.IOStreams) *co
o.PrintFlags.AddFlags(cmd)

cmdutil.AddFilenameOptionFlags(cmd, o.FilenameOptions, "identifying the resource to reconcile.")
cmd.Flags().BoolVar(&o.DryRun, "dry-run", false, "If true, display results but do not submit changes")

This comment has been minimized.

@deads2k

deads2k May 29, 2018

Contributor

default value (third arg) should be o.DryRun

@@ -47,6 +47,8 @@ type ReconcileOptions struct {
PrintObject printers.ResourcePrinterFunc

genericclioptions.IOStreams

DryRun bool

This comment has been minimized.

@deads2k

deads2k May 29, 2018

Contributor

Move up with other flags that get bound (near the top).

@deads2k

This comment has been minimized.

Copy link
Contributor

deads2k commented May 29, 2018

Minor comments, but I'd like to see the the default value change

/approve
/hold

holding so the default value can change. @enj feel free to remove hold after update.

@mrogers950 mrogers950 force-pushed the mrogers950:reconcile-dryrun-additive branch from dc342ef to 1dcdd2b May 29, 2018

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 29, 2018

@mrogers950

This comment has been minimized.

Copy link
Contributor Author

mrogers950 commented May 29, 2018

@deads2k updated with those changes

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

Comments addressed.

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label May 29, 2018

@@ -128,6 +130,9 @@ func (o *ReconcileOptions) Complete(cmd *cobra.Command, f cmdutil.Factory, args
return err
}

if o.DryRun {
o.PrintFlags = genericclioptions.NewPrintFlags("not reconciled (dry run)").WithTypeSetter(scheme.Scheme)

This comment has been minimized.

@juanvallejo

juanvallejo May 29, 2018

Member

Normally, we set the print flags once, and if we need to account for a dry run message, we use the Complete method in the printflags struct: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_env.go#L219-L225

Add dry-run to auth reconcile
Signed-off-by: Matt Rogers <mrogers@redhat.com>

@mrogers950 mrogers950 force-pushed the mrogers950:reconcile-dryrun-additive branch from 1dcdd2b to 20cd94d May 29, 2018

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 29, 2018

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

/lgtm

Retagging.

@k8s-ci-robot k8s-ci-robot added the lgtm label May 29, 2018

@mrogers950

This comment has been minimized.

Copy link
Contributor Author

mrogers950 commented May 29, 2018

@juanvallejo thanks, updated

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented May 29, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, enj, mrogers950

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

@enj

This comment has been minimized.

Copy link
Member

enj commented May 29, 2018

/retest

1 similar comment
@mrogers950

This comment has been minimized.

Copy link
Contributor Author

mrogers950 commented May 29, 2018

/retest

@soltysh
Copy link
Contributor

soltysh left a comment

lgtm as well

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented May 30, 2018

[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process

@deads2k @enj @mrogers950

Pull Request Labels
  • sig/cli: Pull Request will be escalated to these SIGs if needed.
  • priority/important-longterm: Escalate to the pull request owners; move out of the milestone after 1 attempt.
  • kind/cleanup: Adding tests, refactoring, fixing old bugs.
Help
@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented May 30, 2018

Automatic merge from submit-queue (batch tested with PRs 64322, 64210, 64458, 64232, 64370). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 75517f6 into kubernetes:master May 30, 2018

18 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation mrogers950 authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.