From 8dee3caa06db24b973821bd85da146e4c9246fa8 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Thu, 23 May 2024 19:06:30 +0800 Subject: [PATCH] fix: don't need match number for labels/annotations fix: don't need match number for labels/annotations --- pkg/controller/minio-services.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/controller/minio-services.go b/pkg/controller/minio-services.go index 36e00a32943..f3dbd9a2109 100644 --- a/pkg/controller/minio-services.go +++ b/pkg/controller/minio-services.go @@ -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")