mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
fix bug in dynamicResourceClient.UpdateStatus should encode
This commit is contained in:
parent
393324497f
commit
9e8ce9535d
@ -158,8 +158,17 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured) (*u
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result := c.client.client.Put().AbsPath(append(c.makeURLSegments(accessor.GetName()), "status")...).Body(obj).Do()
|
outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
|
||||||
uncastObj, err := result.Get()
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result := c.client.client.Put().AbsPath(append(c.makeURLSegments(accessor.GetName()), "status")...).Body(outBytes).Do()
|
||||||
|
retBytes, err := result.Raw()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -167,9 +176,6 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured) (*u
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions) error {
|
func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions) error {
|
||||||
if opts == nil {
|
|
||||||
opts = &metav1.DeleteOptions{}
|
|
||||||
}
|
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
opts = &metav1.DeleteOptions{}
|
opts = &metav1.DeleteOptions{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user