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 new command "kubectl set selector" #38966
Conversation
@kubernetes/kubectl |
Jenkins GCE etcd3 e2e failed for commit 992baaa. Full PR test history. The magic incantation to run this job again is |
@k8s-bot gce etcd3 e2e test this |
@@ -147,9 +147,9 @@ type ClientAccessFactory interface { | |||
// Returns a Printer for formatting objects of the given type or an error. | |||
Printer(mapping *meta.RESTMapping, options kubectl.PrintOptions) (kubectl.ResourcePrinter, error) | |||
// Pauser marks the object in the info as paused ie. it will not be reconciled by its controller. | |||
Pauser(info *resource.Info) (bool, error) | |||
Pauser(info *resource.Info) ([]byte, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe []byte
in the Godoc here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, looks good to me. Might be good for someone else to cast a critical eye.
// CalculatePatches calls the mutation function on each provided info object, and generates a strategic merge patch for | ||
// the changes in the object. Encoder must be able to encode the info into the appropriate destination type. If mutateFn | ||
// returns false, the object is not included in the final list of patches. | ||
func CalculatePatches(infos []*resource.Info, encoder runtime.Encoder, mutateFn func(*resource.Info) (bool, error)) []*Patch { | ||
func CalculatePatches(infos []*resource.Info, encoder runtime.Encoder, mutateFn func(*resource.Info) ([]byte, error)) []*Patch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc is now wrong. update with what the mutateFn
returns now. Also, promote it to a real type and doc it there.
// SelectorOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of | ||
// referencing the cmd.Flags() | ||
type SelectorOptions struct { | ||
fnOptions resource.FilenameOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileOptions
. fn
looks too much line function.
cmdutil.AddFilenameOptionFlags(cmd, &options.fnOptions, usage) | ||
cmdutil.AddDryRunFlag(cmd) | ||
cmdutil.AddRecordFlag(cmd) | ||
cmdutil.AddInclude3rdPartyFlags(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't needed anymore.
minor comments, then lgtm. |
Comments addressed, applying lgtm |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
Continuation of #28949