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

Commit 5985978

Browse files
authored
syncer: check meta equality for sa type token secret (#83)
Signed-off-by: zhuangqh <[email protected]>
1 parent 20bf742 commit 5985978

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

virtualcluster/pkg/syncer/conversion/equality.go

+17-2
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,24 @@ 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 {
522-
return nil
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+
}
537+
return updatedObj
523538
}
524539

525540
var updated *v1.Secret

0 commit comments

Comments
 (0)