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
10259c95
Commit
10259c95
authored
Mar 11, 2019
by
jennybuckley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix int/float apply bug
parent
4ea48886
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
typeconverter.go
...endpoints/handlers/fieldmanager/internal/typeconverter.go
+6
-1
typeconverter_test.go
...ints/handlers/fieldmanager/internal/typeconverter_test.go
+0
-2
apply_test.go
test/integration/apiserver/apply/apply_test.go
+13
-0
No files found.
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/typeconverter.go
View file @
10259c95
...
...
@@ -105,7 +105,12 @@ func (c *typeConverter) YAMLToTyped(from []byte) (typed.TypedValue, error) {
return
nil
,
fmt
.
Errorf
(
"error decoding YAML: %v"
,
err
)
}
return
c
.
ObjectToTyped
(
unstructured
)
gvk
:=
unstructured
.
GetObjectKind
()
.
GroupVersionKind
()
t
:=
c
.
parser
.
Type
(
gvk
)
if
t
==
nil
{
return
nil
,
fmt
.
Errorf
(
"no corresponding type for %v"
,
gvk
)
}
return
t
.
FromYAML
(
typed
.
YAMLObject
(
string
(
from
)))
}
func
(
c
*
typeConverter
)
TypedToObject
(
value
typed
.
TypedValue
)
(
runtime
.
Object
,
error
)
{
...
...
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/typeconverter_test.go
View file @
10259c95
...
...
@@ -68,7 +68,6 @@ metadata:
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
...
...
@@ -91,7 +90,6 @@ metadata:
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
...
...
test/integration/apiserver/apply/apply_test.go
View file @
10259c95
...
...
@@ -119,6 +119,19 @@ func TestApplyAlsoCreates(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to retrieve object: %v"
,
err
)
}
// Test that we can re apply with a different field manager and don't get conflicts
_
,
err
=
client
.
CoreV1
()
.
RESTClient
()
.
Patch
(
types
.
ApplyPatchType
)
.
Namespace
(
"default"
)
.
Resource
(
tc
.
resource
)
.
Name
(
tc
.
name
)
.
Param
(
"fieldManager"
,
"apply_test_2"
)
.
Body
([]
byte
(
tc
.
body
))
.
Do
()
.
Get
()
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to re-apply object using Apply patch: %v"
,
err
)
}
}
}
...
...
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