Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Warczarek <[email protected]>
  • Loading branch information
czeslavo and programmer04 authored Oct 8, 2024
1 parent 71f4f3d commit 30511b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions controller/gateway/controller_watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@ func (r *Reconciler) listManagedGatewaysInNamespace(ctx context.Context, obj cli
for _, gateway := range gateways.Items {
objKey := client.ObjectKey{Name: string(gateway.Spec.GatewayClassName)}

_, err := gatewayclass.Get(ctx, r.Client, string(gateway.Spec.GatewayClassName))
if err != nil {
if _, err := gatewayclass.Get(ctx, r.Client, string(gateway.Spec.GatewayClassName)); err != nil {
if errors.As(err, &operatorerrors.ErrUnsupportedGatewayClass{}) {
log.Debug(logger, "gateway class not supported, ignoring", gateway)
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewErrUnsupportedGateway(reason string) ErrUnsupportedGatewayClass {
}

func (e ErrUnsupportedGatewayClass) Error() string {
return fmt.Errorf("unsupported gateway class: %s", e.reason).Error()
return fmt.Sprintf("unsupported gateway class: %s", e.reason)
}

// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 30511b8

Please sign in to comment.