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
8a61368a
Commit
8a61368a
authored
Jan 30, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add details to patch conflict
parent
91440228
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
rest.go
pkg/genericapiserver/endpoints/handlers/rest.go
+6
-6
No files found.
pkg/genericapiserver/endpoints/handlers/rest.go
View file @
8a61368a
...
...
@@ -663,17 +663,17 @@ func patchResource(
return
nil
,
err
}
if
hasConflicts
{
if
glog
.
V
(
4
)
{
diff1
,
_
:=
json
.
Marshal
(
current
PatchMap
)
diff2
,
_
:=
json
.
Marshal
(
originalPatchMap
)
glog
.
Infof
(
"patchResource failed for resource %s, because there is a meaningful conflict.
\n
diff1=%v
\n
, diff2=%v
\n
"
,
name
,
diff1
,
diff2
)
}
diff1
,
_
:=
json
.
Marshal
(
currentPatchMap
)
diff2
,
_
:=
json
.
Marshal
(
original
PatchMap
)
patchDiffErr
:=
fmt
.
Errorf
(
"there is a meaningful conflict:
\n
diff1=%v
\n
, diff2=%v
\n
"
,
diff1
,
diff2
)
glog
.
V
(
4
)
.
Infof
(
"patchResource failed for resource %s, because there is a meaningful conflict.
\n
diff1=%v
\n
, diff2=%v
\n
"
,
name
,
diff1
,
diff2
)
// Return the last conflict error we got if we have one
if
lastConflictErr
!=
nil
{
return
nil
,
lastConflictErr
}
// Otherwise manufacture one of our own
return
nil
,
errors
.
NewConflict
(
resource
.
GroupResource
(),
name
,
nil
)
return
nil
,
errors
.
NewConflict
(
resource
.
GroupResource
(),
name
,
patchDiffErr
)
}
objToUpdate
:=
patcher
.
New
()
...
...
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