Skip to content

Commit

Permalink
Change error message to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixiansong committed Jun 7, 2023
1 parent f8201c4 commit caad544
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/check-gke-ingress/app/ingress/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func CheckL7ILBFrontendConfig(c *IngressChecker) (string, string, string) {
return L7ILBFrontendConfigCheck, report.Skipped, fmt.Sprintf("Ingress %s/%s is not for L7 internal load balancing", c.ingress.Namespace, c.ingress.Name)
}
if _, ok := getFrontendConfigAnnotation(c.ingress); ok {
return L7ILBFrontendConfigCheck, report.Failed, fmt.Sprintf("Ingress %s/%s for L7 internal load balancing has a frontendConfig annotation", c.ingress.Namespace, c.ingress.Name)
return L7ILBFrontendConfigCheck, report.Failed, fmt.Sprintf("Ingress %s/%s for L7 internal load balancing has a frontendConfig annotation, frontendConfig can only be used with external ingresses", c.ingress.Namespace, c.ingress.Name)
}
return L7ILBFrontendConfigCheck, report.Passed, fmt.Sprintf("Ingress %s/%s for L7 internal load balancing does not have a frontendConfig annotation", c.ingress.Namespace, c.ingress.Name)
}
Expand Down Expand Up @@ -202,7 +202,7 @@ func CheckL7ILBNegAnnotation(c *ServiceChecker) (string, string, string) {
}
val, ok := getNegAnnotation(c.service)
if !ok {
return L7ILBNegAnnotationCheck, report.Failed, fmt.Sprintf("No Neg annotation found in service %s/%s for internal HTTP(S) load balancing", c.service.Namespace, c.service.Name)
return L7ILBNegAnnotationCheck, report.Failed, fmt.Sprintf("No Neg annotation found in service %s/%s for internal HTTP(S) load balancing, internal ingresses requires Neg as backends", c.service.Namespace, c.service.Name)
}
var res annotations.NegAnnotation
if err := json.Unmarshal([]byte(val), &res); err != nil {
Expand Down

0 comments on commit caad544

Please sign in to comment.