Skip to content

Commit 434cbed

Browse files
committed
Add TODO to CR / CRB deletion to indicate GC should handle
Adds a TODO to the ClusterRole and ClusterRoleBinding deletion to indicate that cleanup should be handled by the garbage collection controller when implemented. Signed-off-by: hasheddan <[email protected]>
1 parent 26ae2a6 commit 434cbed

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/apis/tenancy/v1alpha1/helper/helper_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"testing"
2121

2222
"github.com/kcp-dev/logicalcluster/v2"
23+
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425
)
2526

pkg/reconciler/tenancy/clusterworkspacedeletion/clusterworkspace_deletion_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ func (c *Controller) finalizeWorkspace(ctx context.Context, workspace *tenancyv1
262262
listOpts := metav1.ListOptions{
263263
LabelSelector: helper.WorkspaceLabelSelector(workspace.Name),
264264
}
265+
266+
// TODO(hasheddan): ClusterRole and ClusterRoleBinding cleanup
267+
// should be handled by garbage collection when the controller is
268+
// implemented.
265269
if err := c.kubeClusterClient.Cluster(clusterName).RbacV1().ClusterRoles().DeleteCollection(ctx, backgroudDeletion, listOpts); err != nil && !apierrors.IsNotFound(err) {
266270
return fmt.Errorf("could not delete clusterroles for workspace %s: %w", clusterName, err)
267271
}

0 commit comments

Comments
 (0)