Skip to content

Commit

Permalink
review update
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
  • Loading branch information
cnvergence committed Jul 31, 2024
1 parent 1537d28 commit 90aa23b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/provider/kubernetes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,13 +771,13 @@ func (r *gatewayAPIReconciler) findReferenceGrant(ctx context.Context, from, to

// processFinalizers encapsulates logic for managing finalizers on GatewayClass and EnvoyProxy objects.
func (r *gatewayAPIReconciler) processFinalizers(ctx context.Context, managedGC *gwapiv1.GatewayClass, resourceTree *gatewayapi.Resources) error {
// Add finalizer to EnvoyProxy if it is referenced by the GatewayClass.
// Add finalizer to EnvoyProxy and GatewayClass if GatewayClass references this EnvoyProxy.
if classRefsEnvoyProxy(managedGC, resourceTree.EnvoyProxyForGatewayClass) && resourceTree.EnvoyProxyForGatewayClass.DeletionTimestamp.IsZero() && managedGC.DeletionTimestamp.IsZero() {
if err := r.addFinalizer(ctx, resourceTree.EnvoyProxyForGatewayClass); err != nil {
return fmt.Errorf("failed adding finalizer to Envoy Proxy %s: %w", resourceTree.EnvoyProxyForGatewayClass.Name, err)
return fmt.Errorf("failed to add finalizer to Envoy Proxy %s: %w", resourceTree.EnvoyProxyForGatewayClass.Name, err)
}
if err := r.addFinalizer(ctx, managedGC); err != nil {
return fmt.Errorf("failed adding finalizer to gatewayclass %s: %w", managedGC.Name, err)
return fmt.Errorf("failed to add finalizer to gatewayclass %s: %w", managedGC.Name, err)
}
}

Expand Down

0 comments on commit 90aa23b

Please sign in to comment.