Skip to content

Commit

Permalink
Fix compare SC
Browse files Browse the repository at this point in the history
Signed-off-by: Neumoin, Konstantin <[email protected]>
  • Loading branch information
Neumoin, Konstantin committed Nov 13, 2024
1 parent 6165f68 commit 2178c81
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,11 @@ func updateStorageClassMetaDataIfNeeded(
cl client.Client,
newSC, oldSC *storagev1.StorageClass,
) error {
needsUpdate := !reflect.DeepEqual(oldSC.Labels, newSC.Labels) ||
!reflect.DeepEqual(oldSC.Annotations, newSC.Annotations) ||
!reflect.DeepEqual(oldSC.Finalizers, newSC.Finalizers)
needsUpdate := !maps.Equal(oldSC.Labels, newSC.Labels) ||
!maps.Equal(oldSC.Annotations, newSC.Annotations) ||
!slices.EqualFunc(newSC.Finalizers, oldSC.Finalizers, func(a, b string) bool {
return a == b
})

if !needsUpdate {
return nil
Expand Down

0 comments on commit 2178c81

Please sign in to comment.