Skip to content

🌱 remove deprecated work execution clusterrolebinding #992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestSyncDelete(t *testing.T) {
}

// 11 managed static manifests + 12 management static manifests + 1 hub kubeconfig + 2 namespaces + 2 deployments
if len(deleteActions) != 29 {
if len(deleteActions) != 28 {
t.Errorf("Expected 28 delete actions, but got %d", len(deleteActions))
}

Expand Down Expand Up @@ -127,7 +127,7 @@ func TestSyncDeleteHosted(t *testing.T) {
}

// 12 static manifests + 2 namespaces
if len(deleteActionsManaged) != 15 {
if len(deleteActionsManaged) != 14 {
t.Errorf("Expected 14 delete actions, but got %d", len(deleteActionsManaged))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,19 @@ import (
"open-cluster-management.io/ocm/pkg/operator/helpers"
)

var (
managedStaticResourceFiles = []string{
"klusterlet/managed/klusterlet-registration-serviceaccount.yaml",
"klusterlet/managed/klusterlet-registration-clusterrole.yaml",
"klusterlet/managed/klusterlet-registration-clusterrole-addon-management.yaml",
"klusterlet/managed/klusterlet-registration-clusterrolebinding.yaml",
"klusterlet/managed/klusterlet-registration-clusterrolebinding-addon-management.yaml",
"klusterlet/managed/klusterlet-work-serviceaccount.yaml",
"klusterlet/managed/klusterlet-work-clusterrole.yaml",
"klusterlet/managed/klusterlet-work-clusterrole-execution.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding-aggregate.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding-execution-admin.yaml",
}

cleanedManagedStaticResourceFiles = append(managedStaticResourceFiles,
"klusterlet/managed/klusterlet-work-clusterrolebinding-execution.yaml")
)
var managedStaticResourceFiles = []string{
"klusterlet/managed/klusterlet-registration-serviceaccount.yaml",
"klusterlet/managed/klusterlet-registration-clusterrole.yaml",
"klusterlet/managed/klusterlet-registration-clusterrole-addon-management.yaml",
"klusterlet/managed/klusterlet-registration-clusterrolebinding.yaml",
"klusterlet/managed/klusterlet-registration-clusterrolebinding-addon-management.yaml",
"klusterlet/managed/klusterlet-work-serviceaccount.yaml",
"klusterlet/managed/klusterlet-work-clusterrole.yaml",
"klusterlet/managed/klusterlet-work-clusterrole-execution.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding-aggregate.yaml",
"klusterlet/managed/klusterlet-work-clusterrolebinding-execution-admin.yaml",
}

// managedReconcile apply resources to managed clusters
type managedReconcile struct {
Expand Down Expand Up @@ -180,7 +175,7 @@ func (r *managedReconcile) clean(ctx context.Context, klusterlet *operatorapiv1.
}

if err := removeStaticResources(ctx, r.managedClusterClients.kubeClient, r.managedClusterClients.apiExtensionClient,
cleanedManagedStaticResourceFiles, config); err != nil {
managedStaticResourceFiles, config); err != nil {
return klusterlet, reconcileStop, err
}

Expand Down
Loading