Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
ensure the klusterlet namespace early
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <jiazhu@redhat.com>
  • Loading branch information
zhujian7 committed Dec 24, 2021
1 parent 73cf438 commit c74c9f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deploy/klusterlet/config/rbac/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ rules:
# Allow the registration-operator to update the appliedmanifestworks finalizer.
- apiGroups: ["work.open-cluster-management.io"]
resources: ["appliedmanifestworks"]
verbs: ["get", "list", "watch", "update"]
verbs: ["list", "update"]
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,13 @@ func (n *klusterletController) cleanUp(
return err
}

// remove AppliedManifestWorks, should be executed **before** "remove the CRDs" and "remove hub kubeconfig secret"
if len(hubHost) > 0 {
if err := n.cleanUpAppliedManifestWorks(ctx, managedClients.appliedManifestWorkClient, hubHost); err != nil {
return err
}
}

// Remove secrets
secrets := []string{config.HubKubeConfigSecret}
if config.InstallMode == operatorapiv1.InstallModeDetached {
Expand Down Expand Up @@ -638,13 +645,6 @@ func (n *klusterletController) cleanUp(
}
}

// remove AppliedManifestWorks, should be executed **before** "remove the CRDs"
if len(hubHost) > 0 {
if err := n.cleanUpAppliedManifestWorks(ctx, managedClients.appliedManifestWorkClient, hubHost); err != nil {
return err
}
}

// remove the CRDs
var crdStaticFiles []string
// CRD v1beta1 was deprecated from k8s 1.16.0 and will be removed in k8s 1.22
Expand Down

0 comments on commit c74c9f3

Please sign in to comment.