From f7d5e6154ed32abda0025d57bb61092a18c5a169 Mon Sep 17 00:00:00 2001 From: Evan Baker Date: Fri, 10 Feb 2023 23:57:24 +0000 Subject: [PATCH 1/2] deprecate SetOwnerRef in favor of SetControllerRef Signed-off-by: Evan Baker --- crd/nodenetworkconfig/client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crd/nodenetworkconfig/client.go b/crd/nodenetworkconfig/client.go index f3113f2c06..016698fc8b 100644 --- a/crd/nodenetworkconfig/client.go +++ b/crd/nodenetworkconfig/client.go @@ -129,8 +129,14 @@ func (c *Client) UpdateSpec(ctx context.Context, key types.NamespacedName, spec return nnc, nil } -// SetOwnerRef sets the owner of the NodeNetworkConfig to the given object, using HTTP Patch +// SetControllerRef sets the controller of the NodeNetworkConfig to the given object atomically, using HTTP Patch. +// Deprecated: SetOwnerRef is deprecated, use the more correctly named SetControllerRef. func (c *Client) SetOwnerRef(ctx context.Context, key types.NamespacedName, owner metav1.Object, fieldManager string) (*v1alpha.NodeNetworkConfig, error) { + return c.SetControllerRef(ctx, key, owner, fieldManager) +} + +// SetControllerRef sets the controller of the NodeNetworkConfig to the given object atomically, using HTTP Patch. +func (c *Client) SetControllerRef(ctx context.Context, key types.NamespacedName, owner metav1.Object, fieldManager string) (*v1alpha.NodeNetworkConfig, error) { obj := genPatchSkel(key) if err := ctrlutil.SetControllerReference(owner, obj, Scheme); err != nil { return nil, errors.Wrapf(err, "failed to set controller reference for nnc") From 85f5339ceb5a1b5346d02b6990052a74702a357c Mon Sep 17 00:00:00 2001 From: Evan Baker Date: Wed, 22 Feb 2023 12:34:10 -0600 Subject: [PATCH 2/2] fix copypasta Co-authored-by: Timothy J. Raymond --- crd/nodenetworkconfig/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crd/nodenetworkconfig/client.go b/crd/nodenetworkconfig/client.go index 016698fc8b..6669f91122 100644 --- a/crd/nodenetworkconfig/client.go +++ b/crd/nodenetworkconfig/client.go @@ -129,7 +129,7 @@ func (c *Client) UpdateSpec(ctx context.Context, key types.NamespacedName, spec return nnc, nil } -// SetControllerRef sets the controller of the NodeNetworkConfig to the given object atomically, using HTTP Patch. +// SetOwnerRef sets the controller of the NodeNetworkConfig to the given object atomically, using HTTP Patch. // Deprecated: SetOwnerRef is deprecated, use the more correctly named SetControllerRef. func (c *Client) SetOwnerRef(ctx context.Context, key types.NamespacedName, owner metav1.Object, fieldManager string) (*v1alpha.NodeNetworkConfig, error) { return c.SetControllerRef(ctx, key, owner, fieldManager)