Skip to content

Commit

Permalink
lint / cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjenkins committed Nov 8, 2024
1 parent a7c2f73 commit 1e508b2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
14 changes: 11 additions & 3 deletions controllers/gateway/controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package gateway contains controllers for Gateway API objects.
package gateway

import (
Expand All @@ -18,6 +19,7 @@ import (
"github.com/pomerium/ingress-controller/pomerium"
)

// DefaultClassControllerName is the default GatewayClass ControllerName.
const DefaultClassControllerName = "pomerium.io/gateway-controller"

// ControllerConfig contains configuration options for the Gateway controller.
Expand Down Expand Up @@ -47,8 +49,11 @@ func NewGatewayController(
ControllerConfig: config,
}

mgr.GetFieldIndexer().IndexField(ctx, &corev1.Secret{}, "type",
err := mgr.GetFieldIndexer().IndexField(ctx, &corev1.Secret{}, "type",
func(o client.Object) []string { return []string{string(o.(*corev1.Secret).Type)} })
if err != nil {
return fmt.Errorf("couldn't create index on Secret type: %w", err)
}

// All updates will trigger the same reconcile request.
enqueueRequest := handler.EnqueueRequestsFromMapFunc(
Expand All @@ -60,7 +65,7 @@ func NewGatewayController(
}}
})

err := ctrl.NewControllerManagedBy(mgr).
err = ctrl.NewControllerManagedBy(mgr).
Named("gateway").
Watches(
&gateway_v1.Gateway{},
Expand Down Expand Up @@ -92,7 +97,10 @@ func (c *gatewayController) Reconcile(ctx context.Context, _ ctrl.Request) (ctrl

config := c.processGateways(ctx, o)

c.SetGatewayConfig(ctx, config)
_, err = c.SetGatewayConfig(ctx, config)
if err != nil {
return ctrl.Result{}, err
}

return ctrl.Result{}, nil
}
3 changes: 2 additions & 1 deletion controllers/gateway/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
context "context"

"github.com/hashicorp/go-set/v3"
"github.com/pomerium/ingress-controller/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
gateway_v1 "sigs.k8s.io/gateway-api/apis/v1"
gateway_v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/pomerium/ingress-controller/util"
)

// objects holds all relevant Gateway objects and their dependencies.
Expand Down
3 changes: 2 additions & 1 deletion controllers/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
context "context"
golog "log"

"github.com/pomerium/ingress-controller/model"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/log"
gateway_v1 "sigs.k8s.io/gateway-api/apis/v1"

"github.com/pomerium/ingress-controller/model"
)

// processGateways updates the status of all Gateways and associated routes, and returns a
Expand Down
2 changes: 1 addition & 1 deletion controllers/gateway/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func processHTTPRoute(
return result
}

// Otherwise check for route attachement with all listeners.
// Otherwise check for route attachment with all listeners.
hostnamesSet := set.New[gateway_v1.Hostname](0)
var reason gateway_v1.RouteConditionReason
for _, l := range listeners {
Expand Down
3 changes: 2 additions & 1 deletion controllers/gateway/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"strings"

"github.com/hashicorp/go-set/v3"
"github.com/pomerium/ingress-controller/model"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
gateway_v1 "sigs.k8s.io/gateway-api/apis/v1"

"github.com/pomerium/ingress-controller/model"
)

type listenerAndStatus struct {
Expand Down

0 comments on commit 1e508b2

Please sign in to comment.