@@ -59,7 +59,7 @@ func (ir *ingressRules) populateServices(log logrus.FieldLogger, s store.Storer,
5959
6060 // if the Kubernetes services have been deemed invalid, log an error message
6161 // and skip the current service.
62- if ! servicesAllUseTheSameKongAnnotations (k8sServices , seenAnnotations , failuresCollector ) {
62+ if ! servicesAllUseTheSameKongAnnotations (k8sServices , seenAnnotations , failuresCollector , key ) {
6363 // The Kong services not having all the k8s services correctly annotated must be marked
6464 // as to be skipped.
6565 serviceNamesToSkip [key ] = nil
@@ -255,6 +255,7 @@ func servicesAllUseTheSameKongAnnotations(
255255 services []* corev1.Service ,
256256 annotations map [string ]string ,
257257 failuresCollector * failures.ResourceFailuresCollector ,
258+ kongServiceName string ,
258259) bool {
259260 match := true
260261 for _ , service := range services {
@@ -270,9 +271,10 @@ func servicesAllUseTheSameKongAnnotations(
270271 valueForThisObject , ok := service .Annotations [k ]
271272 if ! ok {
272273 failuresCollector .PushResourceFailure (
273- fmt .Sprintf ("in the backend group of %d kubernetes services some have the %s annotation while others don't. " +
274- "this is not supported: when multiple services comprise a backend all kong annotations " +
275- "between them must be set to the same value" , len (services ), k ),
274+ fmt .Sprintf ("Service has inconsistent %s annotation and is used in multi-Service backend %s. " +
275+ "All Services in a multi-Service backend must have matching Kong annotations. Review the " +
276+ "associated route resource and align annotations in its multi-Service backends." ,
277+ k , kongServiceName ),
276278 service .DeepCopy (),
277279 )
278280 match = false
@@ -282,9 +284,10 @@ func servicesAllUseTheSameKongAnnotations(
282284
283285 if valueForThisObject != v {
284286 failuresCollector .PushResourceFailure (
285- fmt .Sprintf ("the value of annotation %s is different between the %d services which comprise this backend. " +
286- "this is not supported: when multiple services comprise a backend all kong annotations " +
287- "between them must be set to the same value" , k , len (services )),
287+ fmt .Sprintf ("Service has inconsistent %s annotation and is used in multi-Service backend %s. " +
288+ "All Services in a multi-Service backend must have matching Kong annotations. Review the " +
289+ "associated route resource and align annotations in its multi-Service backends." ,
290+ k , kongServiceName ),
288291 service .DeepCopy (),
289292 )
290293 match = false
0 commit comments