Update set commands#20139
Conversation
391e4a0 to
dfc6405
Compare
pkg/oc/cli/cmd/set/buildsecret.go
Outdated
| } | ||
| actual, err := o.Client.Resource(info.Mapping.Resource).Namespace(info.Namespace).Patch(info.Name, types.StrategicMergePatchType, patch.Patch) | ||
| if err != nil { | ||
| allErrs = append(allErrs, fmt.Errorf("fialed to patch secret %v", err)) |
54f426e to
df4770c
Compare
331ae43 to
9c050c0
Compare
pkg/oc/cli/cmd/set/buildhook.go
Outdated
| kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" | ||
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions" | ||
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource" | ||
| "k8s.io/kubernetes/pkg/printers" |
There was a problem hiding this comment.
I thought we had switched to using the new pkg/genericclioptions/printers pkg?
pkg/oc/cli/cmd/set/buildhook.go
Outdated
| for _, patch := range patches { | ||
| info := patch.Info | ||
| name := info.Name | ||
| if info.Mapping != nil { |
There was a problem hiding this comment.
This fixes the panic we were seeing with --local, right?
(will update upstream PR to match this)
There was a problem hiding this comment.
I've created GetObjectName which I'm guessing you can just add upstream, it does exactly what Jordan asked for.
pkg/oc/cli/cmd/set/buildhook.go
Outdated
|
|
||
| if string(patch.Patch) == "{}" || len(patch.Patch) == 0 { | ||
| fmt.Fprintf(o.Err, "info: %s %q was not changed\n", info.Mapping.Resource, info.Name) | ||
| fmt.Fprintf(o.ErrOut, "info: %s was not changed\n", name) |
There was a problem hiding this comment.
I thought we were getting rid of this message?
There was a problem hiding this comment.
Turned into glog.V(1).Infof("info: %s was not changed\n", name)
pkg/oc/cli/cmd/set/buildsecret.go
Outdated
| kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" | ||
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions" | ||
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource" | ||
| "k8s.io/kubernetes/pkg/printers" |
There was a problem hiding this comment.
genericclioptions/printers?
pkg/oc/cli/cmd/set/deploymenthook.go
Outdated
| return o.PrintObject(infos) | ||
| } | ||
| // if singleItemImplied && len(patches) == 0 { | ||
| // return fmt.Errorf("%s/%s is not a deployment config or does not have an applicable strategy", infos[0].Mapping.Resource, infos[0].Name) |
There was a problem hiding this comment.
Is this leftover, or are we enabling this error message in the future?
pkg/oc/cli/cmd/set/env.go
Outdated
| Client dynamic.Interface | ||
| func NewEnvOptions(streams genericclioptions.IOStreams) *EnvOptions { | ||
| return &EnvOptions{ | ||
| PrintFlags: genericclioptions.NewPrintFlags("updated"), |
There was a problem hiding this comment.
.WithTypeSetter(oscheme.PrintingInternalScheme)?
pkg/oc/cli/cmd/set/probe.go
Outdated
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions" | ||
| "k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource" | ||
| "k8s.io/kubernetes/pkg/kubectl/polymorphichelpers" | ||
| "k8s.io/kubernetes/pkg/printers" |
There was a problem hiding this comment.
genericclioptions/printers
| cmd.Flags().StringVar(&o.HTTPGet, "get-url", o.HTTPGet, "A URL to perform an HTTP GET on (you can omit the host, have a string port, or omit the scheme.") | ||
|
|
||
| o.InitialDelaySeconds = cmd.Flags().Int("initial-delay-seconds", 0, "The time in seconds to wait before the probe begins checking") | ||
| o.SuccessThreshold = cmd.Flags().Int("success-threshold", 0, "The number of successes required before the probe is considered successful") |
There was a problem hiding this comment.
maybe we could switch these to IntVars?
There was a problem hiding this comment.
There are pointer to values, I'm guessing to to differentiate between set and not, although there's .Changed paramter on each flag. But I didn't want to add more to this PR. We can solve it later ;)
|
Comments addressed, ptal. |
|
I'll wait for #20083 to merge and will tag this one. |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Approving based on previous comments and the included commit from #20083 |
|
/retest |
4 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
New changes are detected. LGTM label has been removed. |
|
Rebase only, re-applying the label back. |
|
@soltysh: The following test failed, say
DetailsInstructions 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. I understand the commands that are listed here. |
|
/retest |
/assign @deads2k @juanvallejo