Skip to content

Commit 64b8000

Browse files
add an error case
Signed-off-by: Jintao Zhang <[email protected]>
1 parent 4a1f037 commit 64b8000

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controller/gateway/controller_watch.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/samber/lo"
1010
corev1 "k8s.io/api/core/v1"
11+
apierrors "k8s.io/apimachinery/pkg/api/errors"
1112
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1213
"k8s.io/apimachinery/pkg/types"
1314
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -256,6 +257,12 @@ func (r *Reconciler) listManagedGatewaysInNamespace(ctx context.Context, obj cli
256257
log.Debug(logger, "gateway class not supported, ignoring")
257258
case errors.As(err, &operatorerrors.ErrNotAcceptedGatewayClass{}):
258259
log.Debug(logger, "gateway class not accepted, ignoring")
260+
case apierrors.IsNotFound(err):
261+
log.Debug(logger, "gateway class not found, ignoring (may have been deleted)",
262+
"gatewayClass", objKey.Name,
263+
"gateway", gateway.Name,
264+
"namespace", gateway.Namespace,
265+
)
259266
default:
260267
log.Error(logger, err, "failed to get Gateway's GatewayClass",
261268
"gatewayClass", objKey.Name,

0 commit comments

Comments
 (0)