We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8123b3 commit d68e764Copy full SHA for d68e764
ingress-controller/internal/admission/validator.go
@@ -3,7 +3,6 @@ package admission
3
import (
4
"context"
5
"fmt"
6
- "strings"
7
8
"github.com/go-logr/logr"
9
"github.com/kong/go-kong/kong"
@@ -439,7 +438,7 @@ func (validator KongHTTPValidator) ValidateGateway(
439
438
// validate the gatewayclass reference
440
gwc := gatewayapi.GatewayClass{}
441
if err := validator.ManagerClient.Get(ctx, client.ObjectKey{Name: string(gateway.Spec.GatewayClassName)}, &gwc); err != nil {
442
- if strings.Contains(err.Error(), "not found") {
+ if apierrors.IsNotFound(err) {
443
return true, "", nil // not managed by this controller
444
}
445
return false, ErrTextCantRetrieveGatewayClass, err
0 commit comments