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
93402fc8
Unverified
Commit
93402fc8
authored
Mar 12, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75277 from jennybuckley/fix-ints
Fix server side apply int/float bug
parents
cc8afb25
10259c95
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 @
93402fc8
...
@@ -105,7 +105,12 @@ func (c *typeConverter) YAMLToTyped(from []byte) (typed.TypedValue, error) {
...
@@ -105,7 +105,12 @@ func (c *typeConverter) YAMLToTyped(from []byte) (typed.TypedValue, error) {
return
nil
,
fmt
.
Errorf
(
"error decoding YAML: %v"
,
err
)
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
)
{
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 @
93402fc8
...
@@ -68,7 +68,6 @@ metadata:
...
@@ -68,7 +68,6 @@ metadata:
labels:
labels:
app: nginx
app: nginx
spec:
spec:
replicas: 3
selector:
selector:
matchLabels:
matchLabels:
app: nginx
app: nginx
...
@@ -91,7 +90,6 @@ metadata:
...
@@ -91,7 +90,6 @@ metadata:
labels:
labels:
app: nginx
app: nginx
spec:
spec:
replicas: 3
selector:
selector:
matchLabels:
matchLabels:
app: nginx
app: nginx
...
...
test/integration/apiserver/apply/apply_test.go
View file @
93402fc8
...
@@ -119,6 +119,19 @@ func TestApplyAlsoCreates(t *testing.T) {
...
@@ -119,6 +119,19 @@ func TestApplyAlsoCreates(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to retrieve object: %v"
,
err
)
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