Skip to content

Commit

Permalink
logging help
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Aug 7, 2023
1 parent 31773b6 commit 52acedd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion control-plane/api-gateway/gatekeeper/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (g *Gatekeeper) upsertDeployment(ctx context.Context, gateway gwv1beta1.Gat
// Get Deployment if it exists.
existingDeployment := &appsv1.Deployment{}
exists := false

g.Log.Info("UpsertDeployment")
err := g.Client.Get(ctx, g.namespacedName(gateway), existingDeployment)
if err != nil && !k8serrors.IsNotFound(err) {
return err
Expand Down
7 changes: 6 additions & 1 deletion control-plane/api-gateway/gatekeeper/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ func (g *Gatekeeper) upsertRole(ctx context.Context, gateway gwv1beta1.Gateway,
return g.deleteRole(ctx, types.NamespacedName{Namespace: gateway.Namespace, Name: gateway.Name})
}

g.Log.Info("UpsertRole")

role := &rbac.Role{}

// If the Role already exists, ensure that we own the Role
err := g.Client.Get(ctx, g.namespacedName(gateway), role)
if err != nil && !k8serrors.IsNotFound(err) {
g.Log.Info("UpsertRole Failed")
return err
} else if !k8serrors.IsNotFound(err) {
// Ensure we own the Role.
Expand Down Expand Up @@ -80,6 +83,7 @@ func (g *Gatekeeper) role(gateway gwv1beta1.Gateway, gcc v1alpha1.GatewayClassCo
Verbs: []string{"use"},
})
}
g.Log.Info("------------------------------------------Is Openshift Enabled?")

if config.EnableOpenShift {
g.Log.Info("------------------------------------------Openshift Enabled")
Expand All @@ -88,7 +92,8 @@ func (g *Gatekeeper) role(gateway gwv1beta1.Gateway, gcc v1alpha1.GatewayClassCo
Resources: []string{"securitycontextconstraints"},
// TODO(nathancoleman) Consider accepting an explicit SCC name. This will make the code
// here less brittle and allow for the user to provide their own SCC if they wish.
ResourceNames: []string{config.ReleaseName + "-api-gateway", "gateway-*"},
//ResourceNames: []string{config.ReleaseName + "-api-gateway"},
ResourceNames: []string{"privileged"},
Verbs: []string{"use"},
})
}
Expand Down
2 changes: 2 additions & 0 deletions control-plane/api-gateway/gatekeeper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func (g *Gatekeeper) upsertService(ctx context.Context, gateway gwv1beta1.Gatewa
return g.deleteService(ctx, types.NamespacedName{Namespace: gateway.Namespace, Name: gateway.Name})
}

g.Log.Info("UpsertService")

service := g.service(gateway, gcc)

mutated := service.DeepCopy()
Expand Down

0 comments on commit 52acedd

Please sign in to comment.