Skip to content

Commit 0527703

Browse files
Update the secret.
1 parent 67ad82b commit 0527703

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

controllers/secretproviderclasspodstatus_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ func (r *SecretProviderClassPodStatusReconciler) createOrUpdateK8sSecret(ctx con
417417
}
418418
if apierrors.IsAlreadyExists(err) {
419419
klog.InfoS("Secret is already there", "secret", klog.ObjectRef{Namespace: namespace, Name: name})
420+
err := r.writer.Update(ctx, secret)
421+
if err == nil {
422+
klog.Errorf("Unable to update secret", "secret", klog.ObjectRef{Namespace: namespace, Name: name})
423+
return err
424+
}
420425
return nil
421426
}
422427
return err

controllers/secretproviderclasspodstatus_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestPatchSecretWithOwnerRef(t *testing.T) {
158158
g.Expect(secret.GetOwnerReferences()).To(HaveLen(1))
159159
}
160160

161-
func TestcreateOrUpdateK8sSecret(t *testing.T) {
161+
func TestCreateOrUpdateK8sSecret(t *testing.T) {
162162
g := NewWithT(t)
163163

164164
scheme, err := setupScheme()

0 commit comments

Comments
 (0)