@@ -296,19 +296,21 @@ func (s *IngressTemplateTest) TestDifferentValuesInputs() {
296296 HelmOptionsExtraArgs : map [string ][]string {"install" : {"--debug" }},
297297 Values : map [string ]string {
298298 "global.ingress.enabled" : "true" ,
299- "global.ingress.labels.app" : "custom-override" ,
300- "global.ingress.labels.environment" : "production" ,
301- "global.ingress.labels.team" : "platform" ,
299+ "global.commonLabels.app" : "common-override" ,
300+ "global.commonLabels.environment" : "common-env" ,
301+ "global.ingress.labels.app" : "ingress-override" ,
302+ "global.ingress.labels.team" : "ingress-team" ,
302303 },
303304 Verifier : func (t * testing.T , output string , err error ) {
304305 var ingress netv1.Ingress
305306 helm .UnmarshalK8SYaml (t , output , & ingress )
306307
307- // then - global ingress labels should override chart labels for same keys
308- s .Require ().Equal ("custom-override" , ingress .Labels ["app" ], "global labels should override chart labels for same key" )
309- // and global-specific labels should be present
310- s .Require ().Equal ("production" , ingress .Labels ["environment" ], "global labels should be present" )
311- s .Require ().Equal ("platform" , ingress .Labels ["team" ], "global labels should be present" )
308+ // then - ingress labels should override common labels for same keys
309+ s .Require ().Equal ("ingress-override" , ingress .Labels ["app" ], "ingress labels should override common labels for same key" )
310+ // and common labels should be present when no ingress label conflicts
311+ s .Require ().Equal ("common-env" , ingress .Labels ["environment" ], "common labels should be present when not overridden" )
312+ // and ingress-specific labels should be present
313+ s .Require ().Equal ("ingress-team" , ingress .Labels ["team" ], "ingress labels should be present" )
312314 // standard chart labels should still be there for non-conflicting keys
313315 s .Require ().Contains (ingress .Labels , "app.kubernetes.io/name" )
314316 },
@@ -415,18 +417,20 @@ func (s *GrpcIngressTemplateTest) TestDifferentValuesInputs() {
415417 Values : map [string ]string {
416418 "orchestration.enabled" : "true" ,
417419 "orchestration.ingress.grpc.enabled" : "true" ,
418- "orchestration.ingress.grpc.labels.app" : "grpc-override" ,
419- "orchestration.ingress.grpc.labels.environment" : "grpc-env" ,
420+ "global.commonLabels.app" : "common-grpc-override" ,
421+ "global.commonLabels.environment" : "common-grpc-env" ,
422+ "orchestration.ingress.grpc.labels.app" : "grpc-specific-override" ,
420423 "orchestration.ingress.grpc.labels.protocol" : "grpc" ,
421424 },
422425 Verifier : func (t * testing.T , output string , err error ) {
423426 var ingress netv1.Ingress
424427 helm .UnmarshalK8SYaml (t , output , & ingress )
425428
426- // then - grpc-specific labels should override chart labels for same keys
427- s .Require ().Equal ("grpc-override" , ingress .Labels ["app" ], "grpc labels should override chart labels for same key" )
429+ // then - grpc-specific labels should override common labels for same keys
430+ s .Require ().Equal ("grpc-specific-override" , ingress .Labels ["app" ], "grpc labels should override common labels for same key" )
431+ // and common labels should be present when no grpc label conflicts
432+ s .Require ().Equal ("common-grpc-env" , ingress .Labels ["environment" ], "common labels should be present when not overridden" )
428433 // and grpc-specific labels should be present
429- s .Require ().Equal ("grpc-env" , ingress .Labels ["environment" ], "grpc-specific labels should be present" )
430434 s .Require ().Equal ("grpc" , ingress .Labels ["protocol" ], "grpc-specific labels should be present" )
431435 // standard chart labels should still be there for non-conflicting keys
432436 s .Require ().Contains (ingress .Labels , "app.kubernetes.io/name" )
0 commit comments