diff --git a/deprecated-dynamic/client.go b/deprecated-dynamic/client.go index 3b8efffa..bcbfed70 100644 --- a/deprecated-dynamic/client.go +++ b/deprecated-dynamic/client.go @@ -127,5 +127,5 @@ func (s oldResourceShimType) List(opts metav1.ListOptions) (runtime.Object, erro } func (s oldResourceShimType) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error) { - return s.ResourceInterface.Patch(name, pt, data, metav1.UpdateOptions{}, s.subresources...) + return s.ResourceInterface.Patch(name, pt, data, metav1.PatchOptions{}, s.subresources...) } diff --git a/dynamic/client_test.go b/dynamic/client_test.go index e74cb832..0edf3265 100644 --- a/dynamic/client_test.go +++ b/dynamic/client_test.go @@ -638,7 +638,7 @@ func TestPatch(t *testing.T) { } defer srv.Close() - got, err := cl.Resource(resource).Namespace(tc.namespace).Patch(tc.name, types.StrategicMergePatchType, tc.patch, metav1.UpdateOptions{}, tc.subresource...) + got, err := cl.Resource(resource).Namespace(tc.namespace).Patch(tc.name, types.StrategicMergePatchType, tc.patch, metav1.PatchOptions{}, tc.subresource...) if err != nil { t.Errorf("unexpected error when patching %q: %v", tc.name, err) continue diff --git a/dynamic/fake/simple.go b/dynamic/fake/simple.go index 6ce3b9b4..819b8d9c 100644 --- a/dynamic/fake/simple.go +++ b/dynamic/fake/simple.go @@ -333,7 +333,7 @@ func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, } // TODO: opts are currently ignored. -func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { diff --git a/dynamic/fake/simple_test.go b/dynamic/fake/simple_test.go index f0991956..183420fc 100644 --- a/dynamic/fake/simple_test.go +++ b/dynamic/fake/simple_test.go @@ -96,7 +96,7 @@ func (tc *patchTestCase) runner(t *testing.T) { client := NewSimpleDynamicClient(runtime.NewScheme(), tc.object) resourceInterface := client.Resource(schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource}).Namespace(testNamespace) - got, recErr := resourceInterface.Patch(testName, tc.patchType, tc.patchBytes, metav1.UpdateOptions{}) + got, recErr := resourceInterface.Patch(testName, tc.patchType, tc.patchBytes, metav1.PatchOptions{}) if err := tc.verifyErr(recErr); err != nil { t.Error(err) diff --git a/dynamic/interface.go b/dynamic/interface.go index c457be17..70756a4f 100644 --- a/dynamic/interface.go +++ b/dynamic/interface.go @@ -37,7 +37,7 @@ type ResourceInterface interface { Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) + Patch(name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) } type NamespaceableResourceInterface interface { diff --git a/dynamic/simple.go b/dynamic/simple.go index 9e21cda6..852f0c51 100644 --- a/dynamic/simple.go +++ b/dynamic/simple.go @@ -283,7 +283,7 @@ func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, WatchWithSpecificDecoders(wrappedDecoderFn, unstructured.UnstructuredJSONScheme) } -func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { result := c.client.client. Patch(pt). AbsPath(append(c.makeURLSegments(name), subresources...)...).