diff --git a/pkg/operator/ceph/controller/mirror_peer.go b/pkg/operator/ceph/controller/mirror_peer.go index d033488e9..25f0fc4ba 100644 --- a/pkg/operator/ceph/controller/mirror_peer.go +++ b/pkg/operator/ceph/controller/mirror_peer.go @@ -107,7 +107,7 @@ func CreateBootstrapPeerSecret(ctx *clusterd.Context, clusterInfo *cephclient.Cl // Create Secret logger.Debugf("store %s-mirror bootstrap token in a Kubernetes Secret %q in namespace %q", daemonType, s.Name, ns) - _, err = k8sutil.CreateOrUpdateSecret(ctx.Clientset, s) + _, err = k8sutil.CreateOrUpdateSecret(clusterInfo.Context, ctx.Clientset, s) if err != nil && !kerrors.IsAlreadyExists(err) { return ImmediateRetryResult, errors.Wrapf(err, "failed to create %s-mirror bootstrap peer %q secret", daemonType, s.Name) } diff --git a/pkg/operator/k8sutil/replicaset.go b/pkg/operator/k8sutil/replicaset.go index 9b719e9d1..d502752d8 100644 --- a/pkg/operator/k8sutil/replicaset.go +++ b/pkg/operator/k8sutil/replicaset.go @@ -24,8 +24,7 @@ import ( ) // DeleteReplicaSet makes a best effort at deleting a deployment and its pods, then waits for them to be deleted -func DeleteReplicaSet(clientset kubernetes.Interface, namespace, name string) error { - ctx := context.TODO() +func DeleteReplicaSet(ctx context.Context, clientset kubernetes.Interface, namespace, name string) error { deleteAction := func(options *metav1.DeleteOptions) error { return clientset.AppsV1().ReplicaSets(namespace).Delete(ctx, name, *options) } diff --git a/pkg/operator/k8sutil/secret.go b/pkg/operator/k8sutil/secret.go index e63f98332..3a68ac4af 100644 --- a/pkg/operator/k8sutil/secret.go +++ b/pkg/operator/k8sutil/secret.go @@ -27,8 +27,7 @@ import ( ) // CreateOrUpdateSecret creates a secret or updates the secret declaratively if it already exists. -func CreateOrUpdateSecret(clientset kubernetes.Interface, secretDefinition *v1.Secret) (*v1.Secret, error) { - ctx := context.TODO() +func CreateOrUpdateSecret(ctx context.Context, clientset kubernetes.Interface, secretDefinition *v1.Secret) (*v1.Secret, error) { name := secretDefinition.Name logger.Debugf("creating secret %s", name)