mirror of https://github.com/k3s-io/k3s
Merge pull request #75277 from jennybuckley/fix-ints
Fix server side apply int/float bugpull/564/head
commit
93402fc8e8
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue