-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
fix --local panic in set commands #65636
fix --local panic in set commands #65636
Conversation
098122a
to
e1cbe7f
Compare
de28d7d
to
c821f1d
Compare
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.
/lgtm
/approve
pkg/kubectl/cmd/set/set_env.go
Outdated
@@ -471,7 +471,7 @@ func (o *EnvOptions) RunEnv() error { | |||
for _, patch := range patches { | |||
info := patch.Info | |||
if patch.Err != nil { | |||
allErrs = append(allErrs, fmt.Errorf("error: %s/%s %v\n", info.Mapping.Resource, info.Name, patch.Err)) | |||
allErrs = append(allErrs, fmt.Errorf("error: %s/%s %v\n", info.Object.GetObjectKind().GroupVersionKind().Kind, info.Name, patch.Err)) |
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.
kind is not the same as resource... this changes the output 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.
Good point.
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.
Since we were panicing on --local before (hence no output to change under that code path), I can go ahead and leave info.Mapping.Resource as it was, and only output kind under --local. wdyt?
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.
That's a reasonable middle ground, eventually we can entirely skip that part of the message with --local
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.
I guess we can do the same thing we do for -o name without resource info... lower(<kind>[.<group>])
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.
Thanks, PR updated
/hold |
c821f1d
to
40df4e5
Compare
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-e2e-kops-aws |
@liggitt friendly ping |
pkg/kubectl/cmd/util/helpers.go
Outdated
@@ -597,6 +597,19 @@ func ManualStrip(file []byte) []byte { | |||
return stripped | |||
} | |||
|
|||
// GetObjectName receives a resource Info and returns an approximate | |||
// form of the resource's kind/name. | |||
func GetObjectName(info *resource.Info) string { |
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.
any reason not to make this a method on resource.Info, similar to it's existing String()
method?
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.
I'll open a followup to address that.
@juanvallejo please address Jordan's comments. |
/sig cli |
Sorry about my delay here. Will find some time to wrap this PR up this week |
@juanvallejo friendly ping |
a4fc40a
to
099f987
Compare
/test pull-kubernetes-integration |
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.
/lgtm
/approve
pkg/kubectl/cmd/util/helpers.go
Outdated
@@ -597,6 +597,19 @@ func ManualStrip(file []byte) []byte { | |||
return stripped | |||
} | |||
|
|||
// GetObjectName receives a resource Info and returns an approximate | |||
// form of the resource's kind/name. | |||
func GetObjectName(info *resource.Info) string { |
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.
I'll open a followup to address that.
74e3d9c
to
bded018
Compare
bded018
to
e8df247
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: juanvallejo, 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 |
/retest Review the full test history for this PR. Silence the bot with an |
Release note:
In progress - identifying other commands with this issuecc @soltysh