Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit ffc85ed

Browse files
committed
syncer: check meta equality for sa type token secret
Signed-off-by: zhuangqh <[email protected]>
1 parent dcdeedb commit ffc85ed

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

virtualcluster/pkg/syncer/conversion/equality.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,23 @@ func (e vcEquality) CheckBinaryDataEquality(pObj, vObj map[string][]byte) (map[s
517517
}
518518

519519
func (e vcEquality) CheckSecretEquality(pObj, vObj *v1.Secret) *v1.Secret {
520-
// ignore service account token type secret.
521520
if vObj.Type == v1.SecretTypeServiceAccountToken {
521+
var updatedObj *v1.Secret
522+
labels, equal := e.checkDWKVEquality(pObj.Labels, vObj.Labels)
523+
if !equal {
524+
if updatedObj == nil {
525+
updatedObj = pObj.DeepCopy()
526+
}
527+
updatedObj.Labels = labels
528+
}
529+
530+
annotations, equal := e.checkDWKVEquality(pObj.Annotations, vObj.Annotations)
531+
if !equal {
532+
if updatedObj == nil {
533+
updatedObj = pObj.DeepCopy()
534+
}
535+
updatedObj.Annotations = annotations
536+
}
522537
return nil
523538
}
524539

0 commit comments

Comments
 (0)