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

fix --local panic in set commands #65636

Merged
merged 1 commit into from Feb 8, 2019

Conversation

@juanvallejo
Copy link
Member

juanvallejo commented Jun 29, 2018

Release note:

Fixed panic when performing a "set env" operation on a --local resource

In progress - identifying other commands with this issue

cc @soltysh

@juanvallejo juanvallejo changed the title fix --local panic "set env" [WIP] fix --local panic "set env" Jun 29, 2018

@k8s-ci-robot k8s-ci-robot requested review from mengqiy and smarterclayton Jun 29, 2018

@juanvallejo juanvallejo changed the title [WIP] fix --local panic "set env" fix --local panic in set commands Jun 29, 2018

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch from 098122a to e1cbe7f Jun 29, 2018

@k8s-ci-robot k8s-ci-robot added size/S and removed size/XS labels Jun 29, 2018

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch 2 times, most recently from de28d7d to c821f1d Jun 29, 2018

@soltysh
Copy link
Contributor

soltysh left a comment

/lgtm
/approve

@@ -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))

This comment has been minimized.

@liggitt

liggitt Jun 29, 2018

Member

kind is not the same as resource... this changes the output here

This comment has been minimized.

@soltysh

soltysh Jun 29, 2018

Contributor

Good point.

This comment has been minimized.

@juanvallejo

juanvallejo Jun 29, 2018

Author Member

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?

This comment has been minimized.

@soltysh

soltysh Jun 29, 2018

Contributor

That's a reasonable middle ground, eventually we can entirely skip that part of the message with --local

This comment has been minimized.

@liggitt

liggitt Jun 30, 2018

Member

I guess we can do the same thing we do for -o name without resource info... lower(<kind>[.<group>])

This comment has been minimized.

@juanvallejo

juanvallejo Jul 12, 2018

Author Member

Thanks, PR updated

@juanvallejo

This comment has been minimized.

Copy link
Member Author

juanvallejo commented Jun 29, 2018

/hold

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch from c821f1d to 40df4e5 Jun 29, 2018

@k8s-ci-robot k8s-ci-robot added size/M approved and removed lgtm size/S labels Jun 29, 2018

@idealhack

This comment has been minimized.

Copy link
Member

idealhack commented Jun 30, 2018

/test pull-kubernetes-e2e-gce

@juanvallejo

This comment has been minimized.

Copy link
Member Author

juanvallejo commented Jul 23, 2018

@liggitt friendly ping

@@ -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 {

This comment has been minimized.

@liggitt

liggitt Jul 26, 2018

Member

any reason not to make this a method on resource.Info, similar to it's existing String() method?

This comment has been minimized.

@soltysh

soltysh Feb 7, 2019

Contributor

I'll open a followup to address that.

@soltysh

This comment has been minimized.

Copy link
Contributor

soltysh commented Aug 15, 2018

@juanvallejo please address Jordan's comments.

@nikhita

This comment has been minimized.

Copy link
Member

nikhita commented Sep 25, 2018

/sig cli
/kind bug

@juanvallejo

This comment has been minimized.

Copy link
Member Author

juanvallejo commented Sep 25, 2018

@soltysh

please address Jordan's comments.

Sorry about my delay here. Will find some time to wrap this PR up this week

@soltysh

This comment has been minimized.

Copy link
Contributor

soltysh commented Jan 15, 2019

@juanvallejo friendly ping

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch from a4fc40a to 099f987 Feb 6, 2019

@juanvallejo

This comment has been minimized.

Copy link
Member Author

juanvallejo commented Feb 6, 2019

/test pull-kubernetes-integration

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 7, 2019

@soltysh

soltysh approved these changes Feb 7, 2019

Copy link
Contributor

soltysh left a comment

/lgtm
/approve

@@ -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 {

This comment has been minimized.

@soltysh

soltysh Feb 7, 2019

Contributor

I'll open a followup to address that.

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch from 74e3d9c to bded018 Feb 7, 2019

@juanvallejo juanvallejo force-pushed the juanvallejo:jvallejo/fix-local-panic branch from bded018 to e8df247 Feb 7, 2019

@soltysh

soltysh approved these changes Feb 7, 2019

Copy link
Contributor

soltysh left a comment

/lgtm

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 7, 2019

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 7, 2019

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented Feb 8, 2019

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 836ce9f into kubernetes:master Feb 8, 2019

13 checks passed

cla/linuxfoundation juanvallejo authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
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-godeps Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
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.