diff --git a/pkg/cloud/services/gc/ec2.go b/pkg/cloud/services/gc/ec2.go index 92e224ff81..817dbd78a1 100644 --- a/pkg/cloud/services/gc/ec2.go +++ b/pkg/cloud/services/gc/ec2.go @@ -37,7 +37,7 @@ func (s *Service) deleteSecurityGroups(ctx context.Context, resources []*AWSReso groupID := strings.ReplaceAll(resource.ARN.Resource, "security-group/", "") if err := s.deleteSecurityGroup(ctx, groupID); err != nil { - return fmt.Errorf("deleting security group %s: %w", groupID, err) + return fmt.Errorf("deleting security group %q with ID %s: %w", resource.ARN, groupID, err) } } s.scope.Debug("Finished processing resources for security group deletion") diff --git a/pkg/cloud/services/gc/loadbalancer.go b/pkg/cloud/services/gc/loadbalancer.go index 3867a0d165..d649aaa2a6 100644 --- a/pkg/cloud/services/gc/loadbalancer.go +++ b/pkg/cloud/services/gc/loadbalancer.go @@ -70,9 +70,8 @@ func (s *Service) deleteTargetGroups(ctx context.Context, resources []*AWSResour continue } - name := strings.ReplaceAll(resource.ARN.Resource, "targetgroup/", "") if err := s.deleteTargetGroup(ctx, resource.ARN.String()); err != nil { - return fmt.Errorf("deleting target group %s: %w", name, err) + return fmt.Errorf("deleting target group %q: %w", resource.ARN, err) } } s.scope.Debug("Finished processing resources for target group deletion")