Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a155111a
Commit
a155111a
authored
Jan 27, 2017
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print resource name when patch is done
parent
5fc6e2d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
patch.go
pkg/kubectl/cmd/patch.go
+1
-1
patch_test.go
pkg/kubectl/cmd/patch_test.go
+2
-2
No files found.
pkg/kubectl/cmd/patch.go
View file @
a155111a
...
@@ -209,7 +209,7 @@ func RunPatch(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []strin
...
@@ -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
{
if
options
.
OutputFormat
==
"name"
||
len
(
options
.
OutputFormat
)
==
0
{
cmdutil
.
PrintSuccess
(
mapper
,
options
.
OutputFormat
==
"name"
,
out
,
""
,
n
ame
,
false
,
dataChangedMsg
)
cmdutil
.
PrintSuccess
(
mapper
,
options
.
OutputFormat
==
"name"
,
out
,
info
.
Mapping
.
Resource
,
info
.
N
ame
,
false
,
dataChangedMsg
)
}
}
return
nil
return
nil
}
}
...
...
pkg/kubectl/cmd/patch_test.go
View file @
a155111a
...
@@ -54,7 +54,7 @@ func TestPatchObject(t *testing.T) {
...
@@ -54,7 +54,7 @@ func TestPatchObject(t *testing.T) {
cmd
.
Run
(
cmd
,
[]
string
{
"services/frontend"
})
cmd
.
Run
(
cmd
,
[]
string
{
"services/frontend"
})
// uses the name from the file, not the response
// 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
())
t
.
Errorf
(
"unexpected output: %s"
,
buf
.
String
())
}
}
}
}
...
@@ -88,7 +88,7 @@ func TestPatchObjectFromFile(t *testing.T) {
...
@@ -88,7 +88,7 @@ func TestPatchObjectFromFile(t *testing.T) {
cmd
.
Run
(
cmd
,
[]
string
{})
cmd
.
Run
(
cmd
,
[]
string
{})
// uses the name from the file, not the response
// 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
())
t
.
Errorf
(
"unexpected output: %s"
,
buf
.
String
())
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment