Skip to content

Commit

Permalink
Fix: delete addon crd at first (open-cluster-management-io#277)
Browse files Browse the repository at this point in the history
This is to ensure manifestwork of addon is deleted at first.

Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
  • Loading branch information
qiujian16 authored Sep 28, 2022
1 parent 0944f98 commit 79c6b55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ import (
)

var (
// crdNames is the list of CRDs to be wiped out before deleting other resources when clusterManager is deleted.
// The order of the list matters, the managedclusteraddon crd needs to be deleted at first so all addon related
// manifestwork is deleted, then other manifestworks.
crdNames = []string{
"managedclusteraddons.addon.open-cluster-management.io",
"manifestworks.work.open-cluster-management.io",
"managedclusters.cluster.open-cluster-management.io",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func TestSyncDelete(t *testing.T) {
}
}
// Check if resources are created as expected
testinghelper.AssertEqualNumber(t, len(deleteCRDActions), 12)
testinghelper.AssertEqualNumber(t, len(deleteCRDActions), 13)

deleteAPIServiceActions := []clienttesting.DeleteActionImpl{}
apiServiceActions := tc.apiRegistrationClient.Actions()
Expand Down

0 comments on commit 79c6b55

Please sign in to comment.