Skip to content

Commit

Permalink
fix: don't need match number for labels/annotations for service diff (#…
Browse files Browse the repository at this point in the history
…2129)

fix: don't need match number for labels/annotations
  • Loading branch information
jiuker authored May 24, 2024
1 parent 1c2fa4f commit a57c3e0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/controller/minio-services.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,11 @@ func (c *Controller) checkMinIOSvc(ctx context.Context, tenant *miniov2.Tenant,
}

func minioSvcMatchesSpecification(svc *corev1.Service, expectedSvc *corev1.Service) (bool, error) {
// expected labels match
if len(svc.ObjectMeta.Labels) != len(expectedSvc.ObjectMeta.Labels) {
return false, errors.New("service labels don't match")
}
for k, expVal := range expectedSvc.ObjectMeta.Labels {
if value, ok := svc.ObjectMeta.Labels[k]; !ok || value != expVal {
return false, errors.New("service labels don't match")
}
}
// expected annotations match
if len(svc.ObjectMeta.Annotations) != len(expectedSvc.ObjectMeta.Annotations) {
return false, errors.New("service annotations don't match")
}
for k, expVal := range expectedSvc.ObjectMeta.Annotations {
if value, ok := svc.ObjectMeta.Annotations[k]; !ok || value != expVal {
return false, errors.New("service annotations don't match")
Expand Down

0 comments on commit a57c3e0

Please sign in to comment.