Skip to content

Commit 6df5e95

Browse files
committed
certrotation: update caBundleConfigMap after labels have been applied
This prevents http 409 errors when both labels and content need updating in one sync
1 parent 558ed29 commit 6df5e95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/operator/certrotation/cabundle.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ func (c CABundleConfigMap) EnsureConfigMapCABundle(ctx context.Context, signingC
6464
}
6565
needsMetadataUpdate = c.AdditionalAnnotations.EnsureTLSMetadataUpdate(&caBundleConfigMap.ObjectMeta) || needsMetadataUpdate
6666
if needsMetadataUpdate && len(caBundleConfigMap.ResourceVersion) > 0 {
67-
_, _, err := resourceapply.ApplyConfigMap(ctx, c.Client, c.EventRecorder, caBundleConfigMap)
67+
actualCABundleConfigMap, _, err := resourceapply.ApplyConfigMap(ctx, c.Client, c.EventRecorder, caBundleConfigMap)
6868
if err != nil {
6969
return nil, err
7070
}
71+
caBundleConfigMap = actualCABundleConfigMap
7172
}
7273

7374
updatedCerts, err := manageCABundleConfigMap(caBundleConfigMap, signingCertKeyPair.Config.Certs[0])

0 commit comments

Comments
 (0)