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

Print resource name when patch is done #40618

Merged
merged 1 commit into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func RunPatch(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []strin
}

if options.OutputFormat == "name" || len(options.OutputFormat) == 0 {
cmdutil.PrintSuccess(mapper, options.OutputFormat == "name", out, "", name, false, dataChangedMsg)
cmdutil.PrintSuccess(mapper, options.OutputFormat == "name", out, info.Mapping.Resource, info.Name, false, dataChangedMsg)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubectl/cmd/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestPatchObject(t *testing.T) {
cmd.Run(cmd, []string{"services/frontend"})

// uses the name from the file, not the response
if buf.String() != "frontend\n" {
if buf.String() != "service/frontend\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ func TestPatchObjectFromFile(t *testing.T) {
cmd.Run(cmd, []string{})

// uses the name from the file, not the response
if buf.String() != "frontend\n" {
if buf.String() != "service/frontend\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}