Skip to content

Commit

Permalink
lintfix
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chauhan <shubham@tetrate.io>
  • Loading branch information
chauhanshubham committed Nov 30, 2022
1 parent 0711567 commit d120c23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/provider/kubernetes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, request reconcile.
var cc controlledClasses

for _, gwClass := range gatewayClasses.Items {
gwClass := gwClass
if gwClass.Spec.ControllerName == r.classController {
// The gatewayclass was marked for deletion and the finalizer removed,
// so clean-up dependents.
Expand Down Expand Up @@ -242,13 +243,16 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, request reconcile.
}

for _, gtw := range gatewayList.Items {
gtw := gtw
r.log.Info("processing Gateway", "namespace", gtw.Namespace, "name", gtw.Name)
allAssociatedNamespaces[gtw.Namespace] = struct{}{}

for _, listener := range gtw.Spec.Listeners {
listener := listener
// Get Secret for gateway if it exists.
if terminatesTLS(&listener) {
for _, certRef := range listener.TLS.CertificateRefs {
certRef := certRef
if refsSecret(&certRef) {
secret := new(corev1.Secret)
secretNamespace := gatewayapi.NamespaceDerefOr(certRef.Namespace, gtw.Namespace)
Expand Down Expand Up @@ -292,10 +296,12 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, request reconcile.
return reconcile.Result{}, err
}
for _, tlsRoute := range tlsRouteList.Items {
tlsRoute := tlsRoute
r.log.Info("processing TLSRoute", "namespace", tlsRoute.Namespace, "name", tlsRoute.Name)

for _, rule := range tlsRoute.Spec.Rules {
for _, backendRef := range rule.BackendRefs {
backendRef := backendRef
ref := gatewayapi.UpgradeBackendRef(backendRef)
if err := validateBackendRef(&ref); err != nil {
r.log.Error(err, "invalid backendRef")
Expand Down Expand Up @@ -335,10 +341,12 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, request reconcile.
return reconcile.Result{}, err
}
for _, httpRoute := range httpRouteList.Items {
httpRoute := httpRoute
r.log.Info("processing HTTPRoute", "namespace", httpRoute.Namespace, "name", httpRoute.Name)

for _, rule := range httpRoute.Spec.Rules {
for _, backendRef := range rule.BackendRefs {
backendRef := backendRef
if err := validateBackendRef(&backendRef.BackendRef); err != nil {
r.log.Error(err, "invalid backendRef")
continue
Expand Down

0 comments on commit d120c23

Please sign in to comment.