diff --git a/hack/copy-crds.sh b/hack/copy-crds.sh index bd78f2aeb..6fd613f67 100755 --- a/hack/copy-crds.sh +++ b/hack/copy-crds.sh @@ -8,9 +8,9 @@ for f in $HUB_CRD_FILES do if [ -f "$BASE_DIR/$(basename $f).yaml-patch" ]; then - $1 -o $BASE_DIR/$(basename $f).yaml-patch < $f > ./manifests/cluster-manager/hub/$(basename $f) + "$1" -o "$BASE_DIR/$(basename "$f").yaml-patch" < "$f" > "./manifests/cluster-manager/hub/crds/$(basename "$f")" else - cp $f ./manifests/cluster-manager/hub/ + cp $f ./manifests/cluster-manager/hub/crds fi done diff --git a/hack/verify-crds.sh b/hack/verify-crds.sh index fb36e2777..8bd7351f4 100755 --- a/hack/verify-crds.sh +++ b/hack/verify-crds.sh @@ -8,11 +8,11 @@ for f in $HUB_CRD_FILES do if [ -f "$BASE_DIR/$(basename $f).yaml-patch" ]; then - $1 -o $BASE_DIR/$(basename $f).yaml-patch < $f > ./manifests/cluster-manager/hub/$(basename $f).tmp - diff -N ./manifests/cluster-manager/hub/$(basename $f).tmp ./manifests/cluster-manager/hub/$(basename $f) || ( echo 'crd content is incorrect' && false ) - rm ./manifests/cluster-manager/hub/$(basename $f).tmp + "$1" -o "$BASE_DIR/$(basename "$f").yaml-patch" < "$f" > "./manifests/cluster-manager/hub/crds/$(basename "$f").tmp" + diff -N "./manifests/cluster-manager/hub/crds/$(basename "$f").tmp" "./manifests/cluster-manager/hub/crds/$(basename "$f")" || ( echo 'crd content is incorrect' && false ) + rm "./manifests/cluster-manager/hub/crds/$(basename "$f").tmp" else - diff -N $f ./manifests/cluster-manager/hub/$(basename $f) || ( echo 'crd content is incorrect' && false ) + diff -N "$f" "./manifests/cluster-manager/hub/crds/$(basename "$f")" || ( echo 'crd content is incorrect' && false ) fi done diff --git a/manifests/cluster-manager/hub/cluster-manager-addon-manager-clusterrole.yaml b/manifests/cluster-manager/hub/addon-manager/clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-addon-manager-clusterrole.yaml rename to manifests/cluster-manager/hub/addon-manager/clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-addon-manager-clusterrolebinding.yaml b/manifests/cluster-manager/hub/addon-manager/clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-addon-manager-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/addon-manager/clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-addon-manager-serviceaccount.yaml b/manifests/cluster-manager/hub/addon-manager/serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-addon-manager-serviceaccount.yaml rename to manifests/cluster-manager/hub/addon-manager/serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-addon-manager-work-executor-admin-clusterrolebinding.yaml b/manifests/cluster-manager/hub/addon-manager/work-executor-admin-clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-addon-manager-work-executor-admin-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/addon-manager/work-executor-admin-clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-clusterprofiles-clusterrole.yaml b/manifests/cluster-manager/hub/clusterprofiles/clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-clusterprofiles-clusterrole.yaml rename to manifests/cluster-manager/hub/clusterprofiles/clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-clusterprofiles-clusterrolebinding.yaml b/manifests/cluster-manager/hub/clusterprofiles/clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-clusterprofiles-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/clusterprofiles/clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml b/manifests/cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml b/manifests/cluster-manager/hub/crds/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/manifests/cluster-manager/hub/crds/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml b/manifests/cluster-manager/hub/crds/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_02_clusters.open-cluster-management.io_placements.crd.yaml b/manifests/cluster-manager/hub/crds/0000_02_clusters.open-cluster-management.io_placements.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_02_clusters.open-cluster-management.io_placements.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_02_clusters.open-cluster-management.io_placements.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml b/manifests/cluster-manager/hub/crds/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml b/manifests/cluster-manager/hub/crds/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml diff --git a/manifests/cluster-manager/hub/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml b/manifests/cluster-manager/hub/crds/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml similarity index 100% rename from manifests/cluster-manager/hub/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml rename to manifests/cluster-manager/hub/crds/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrole.yaml b/manifests/cluster-manager/hub/manifestworkreplicaset/clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrole.yaml rename to manifests/cluster-manager/hub/manifestworkreplicaset/clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrolebinding.yaml b/manifests/cluster-manager/hub/manifestworkreplicaset/clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/manifestworkreplicaset/clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-serviceaccount.yaml b/manifests/cluster-manager/hub/manifestworkreplicaset/serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-manifestworkreplicaset-serviceaccount.yaml rename to manifests/cluster-manager/hub/manifestworkreplicaset/serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-placement-clusterrole.yaml b/manifests/cluster-manager/hub/placement/clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-placement-clusterrole.yaml rename to manifests/cluster-manager/hub/placement/clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-placement-clusterrolebinding.yaml b/manifests/cluster-manager/hub/placement/clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-placement-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/placement/clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-placement-serviceaccount.yaml b/manifests/cluster-manager/hub/placement/serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-placement-serviceaccount.yaml rename to manifests/cluster-manager/hub/placement/serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-clusterrole.yaml b/manifests/cluster-manager/hub/registration/clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-clusterrole.yaml rename to manifests/cluster-manager/hub/registration/clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-clusterrolebinding.yaml b/manifests/cluster-manager/hub/registration/clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/registration/clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-serviceaccount.yaml b/manifests/cluster-manager/hub/registration/serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-serviceaccount.yaml rename to manifests/cluster-manager/hub/registration/serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-clusterrole.yaml b/manifests/cluster-manager/hub/registration/webhook-clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-clusterrole.yaml rename to manifests/cluster-manager/hub/registration/webhook-clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-clusterrolebinding.yaml b/manifests/cluster-manager/hub/registration/webhook-clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/registration/webhook-clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-clustersetbinding-validatingconfiguration.yaml b/manifests/cluster-manager/hub/registration/webhook-clustersetbinding-validatingconfiguration.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-clustersetbinding-validatingconfiguration.yaml rename to manifests/cluster-manager/hub/registration/webhook-clustersetbinding-validatingconfiguration.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-endpoint-hosted.yaml b/manifests/cluster-manager/hub/registration/webhook-endpoint-hosted.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-endpoint-hosted.yaml rename to manifests/cluster-manager/hub/registration/webhook-endpoint-hosted.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-mutatingconfiguration.yaml b/manifests/cluster-manager/hub/registration/webhook-mutatingconfiguration.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-mutatingconfiguration.yaml rename to manifests/cluster-manager/hub/registration/webhook-mutatingconfiguration.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-service-hosted.yaml b/manifests/cluster-manager/hub/registration/webhook-service-hosted.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-service-hosted.yaml rename to manifests/cluster-manager/hub/registration/webhook-service-hosted.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-service.yaml b/manifests/cluster-manager/hub/registration/webhook-service.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-service.yaml rename to manifests/cluster-manager/hub/registration/webhook-service.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-serviceaccount.yaml b/manifests/cluster-manager/hub/registration/webhook-serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-serviceaccount.yaml rename to manifests/cluster-manager/hub/registration/webhook-serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-registration-webhook-validatingconfiguration.yaml b/manifests/cluster-manager/hub/registration/webhook-validatingconfiguration.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-registration-webhook-validatingconfiguration.yaml rename to manifests/cluster-manager/hub/registration/webhook-validatingconfiguration.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-executor-admin-clusterrole.yaml b/manifests/cluster-manager/hub/work/executor-admin-clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-executor-admin-clusterrole.yaml rename to manifests/cluster-manager/hub/work/executor-admin-clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-clusterrole.yaml b/manifests/cluster-manager/hub/work/webhook-clusterrole.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-clusterrole.yaml rename to manifests/cluster-manager/hub/work/webhook-clusterrole.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-clusterrolebinding.yaml b/manifests/cluster-manager/hub/work/webhook-clusterrolebinding.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-clusterrolebinding.yaml rename to manifests/cluster-manager/hub/work/webhook-clusterrolebinding.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-endpoint-hosted.yaml b/manifests/cluster-manager/hub/work/webhook-endpoint-hosted.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-endpoint-hosted.yaml rename to manifests/cluster-manager/hub/work/webhook-endpoint-hosted.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-service-hosted.yaml b/manifests/cluster-manager/hub/work/webhook-service-hosted.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-service-hosted.yaml rename to manifests/cluster-manager/hub/work/webhook-service-hosted.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-service.yaml b/manifests/cluster-manager/hub/work/webhook-service.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-service.yaml rename to manifests/cluster-manager/hub/work/webhook-service.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-serviceaccount.yaml b/manifests/cluster-manager/hub/work/webhook-serviceaccount.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-serviceaccount.yaml rename to manifests/cluster-manager/hub/work/webhook-serviceaccount.yaml diff --git a/manifests/cluster-manager/hub/cluster-manager-work-webhook-validatingconfiguration.yaml b/manifests/cluster-manager/hub/work/webhook-validatingconfiguration.yaml similarity index 100% rename from manifests/cluster-manager/hub/cluster-manager-work-webhook-validatingconfiguration.yaml rename to manifests/cluster-manager/hub/work/webhook-validatingconfiguration.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-addon-manager-deployment.yaml b/manifests/cluster-manager/management/addon-manager/deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-addon-manager-deployment.yaml rename to manifests/cluster-manager/management/addon-manager/deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-grpc-server-deployment.yaml b/manifests/cluster-manager/management/grpc-server/deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-grpc-server-deployment.yaml rename to manifests/cluster-manager/management/grpc-server/deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-manifestworkreplicaset-deployment.yaml b/manifests/cluster-manager/management/manifestworkreplicaset/deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-manifestworkreplicaset-deployment.yaml rename to manifests/cluster-manager/management/manifestworkreplicaset/deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-placement-deployment.yaml b/manifests/cluster-manager/management/placement/deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-placement-deployment.yaml rename to manifests/cluster-manager/management/placement/deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-registration-deployment.yaml b/manifests/cluster-manager/management/registration/deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-registration-deployment.yaml rename to manifests/cluster-manager/management/registration/deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-registration-webhook-deployment.yaml b/manifests/cluster-manager/management/registration/webhook-deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-registration-webhook-deployment.yaml rename to manifests/cluster-manager/management/registration/webhook-deployment.yaml diff --git a/manifests/cluster-manager/management/cluster-manager-work-webhook-deployment.yaml b/manifests/cluster-manager/management/work/webhook-deployment.yaml similarity index 100% rename from manifests/cluster-manager/management/cluster-manager-work-webhook-deployment.yaml rename to manifests/cluster-manager/management/work/webhook-deployment.yaml diff --git a/pkg/operator/helpers/helpers_test.go b/pkg/operator/helpers/helpers_test.go index 787528827..de71933da 100644 --- a/pkg/operator/helpers/helpers_test.go +++ b/pkg/operator/helpers/helpers_test.go @@ -899,7 +899,7 @@ func TestGetRelatedResource(t *testing.T) { }{ { name: "get correct crd relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -915,7 +915,7 @@ func TestGetRelatedResource(t *testing.T) { }, { name: "get correct clusterrole relatedResources", - manifestFile: "cluster-manager/hub/cluster-manager-registration-clusterrole.yaml", + manifestFile: "cluster-manager/hub/registration/clusterrole.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -931,7 +931,7 @@ func TestGetRelatedResource(t *testing.T) { }, { name: "get correct deployment relatedResources", - manifestFile: "cluster-manager/management/cluster-manager-registration-deployment.yaml", + manifestFile: "cluster-manager/management/registration/deployment.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", ClusterManagerNamespace: "test-namespace", @@ -977,7 +977,7 @@ func TestSetRelatedResourcesStatusesWithObj(t *testing.T) { }{ { name: "append obj to nil relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -995,7 +995,7 @@ func TestSetRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "append obj to empty relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1013,7 +1013,7 @@ func TestSetRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "append obj to relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1046,7 +1046,7 @@ func TestSetRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "append duplicate obj to relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1100,7 +1100,7 @@ func TestRemoveRelatedResourcesStatusesWithObj(t *testing.T) { }{ { name: "remove obj from nil relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1110,7 +1110,7 @@ func TestRemoveRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "remove obj from empty relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1120,7 +1120,7 @@ func TestRemoveRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "remove obj from relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, @@ -1153,7 +1153,7 @@ func TestRemoveRelatedResourcesStatusesWithObj(t *testing.T) { }, { name: "remove not exist obj from relatedResources", - manifestFile: "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + manifestFile: "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", config: manifests.HubConfig{ ClusterManagerName: "test", Replica: 1, diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go index 7c9654b90..95c9167d5 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go @@ -804,12 +804,12 @@ func newFakeHubConfigWithResourceRequirement(t *testing.T, r *operatorapiv1.Reso func getManifestFiles() []string { return []string{ - "cluster-manager/management/cluster-manager-addon-manager-deployment.yaml", - "cluster-manager/management/cluster-manager-manifestworkreplicaset-deployment.yaml", - "cluster-manager/management/cluster-manager-placement-deployment.yaml", - "cluster-manager/management/cluster-manager-registration-deployment.yaml", - "cluster-manager/management/cluster-manager-registration-webhook-deployment.yaml", - "cluster-manager/management/cluster-manager-work-webhook-deployment.yaml", + "cluster-manager/management/addon-manager/deployment.yaml", + "cluster-manager/management/manifestworkreplicaset/deployment.yaml", + "cluster-manager/management/placement/deployment.yaml", + "cluster-manager/management/registration/deployment.yaml", + "cluster-manager/management/registration/webhook-deployment.yaml", + "cluster-manager/management/work/webhook-deployment.yaml", } } diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_crd_reconcile.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_crd_reconcile.go index 0c58a00fe..c5a0d9570 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_crd_reconcile.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_crd_reconcile.go @@ -37,23 +37,23 @@ var ( // crdResourceFiles should be deployed in the hub cluster hubCRDResourceFiles = []string{ - "cluster-manager/hub/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", - "cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml", - "cluster-manager/hub/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml", - "cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml", - "cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml", - "cluster-manager/hub/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml", - "cluster-manager/hub/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml", - "cluster-manager/hub/0000_02_clusters.open-cluster-management.io_placements.crd.yaml", - "cluster-manager/hub/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml", - "cluster-manager/hub/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml", - "cluster-manager/hub/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml", - "cluster-manager/hub/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml", + "cluster-manager/hub/crds/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml", + "cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml", + "cluster-manager/hub/crds/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml", + "cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml", + "cluster-manager/hub/crds/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml", + "cluster-manager/hub/crds/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml", + "cluster-manager/hub/crds/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml", + "cluster-manager/hub/crds/0000_02_clusters.open-cluster-management.io_placements.crd.yaml", + "cluster-manager/hub/crds/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml", + "cluster-manager/hub/crds/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml", + "cluster-manager/hub/crds/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml", + "cluster-manager/hub/crds/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml", } hubClusterProfileCRDResourceFiles = []string{ // clusterprofile crd - "cluster-manager/hub/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml", + "cluster-manager/hub/crds/0000_00_multicluster.x-k8s.io_clusterprofiles.crd.yaml", } ) diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_hub_reconcile.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_hub_reconcile.go index 7fde626f7..27c86afb6 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_hub_reconcile.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_hub_reconcile.go @@ -28,53 +28,53 @@ var ( // The hubRbacResourceFiles should be deployed in the hub cluster. hubRbacResourceFiles = []string{ // registration - "cluster-manager/hub/cluster-manager-registration-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-registration-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-registration-serviceaccount.yaml", + "cluster-manager/hub/registration/clusterrole.yaml", + "cluster-manager/hub/registration/clusterrolebinding.yaml", + "cluster-manager/hub/registration/serviceaccount.yaml", // registration-webhook - "cluster-manager/hub/cluster-manager-registration-webhook-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-registration-webhook-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-registration-webhook-serviceaccount.yaml", + "cluster-manager/hub/registration/webhook-clusterrole.yaml", + "cluster-manager/hub/registration/webhook-clusterrolebinding.yaml", + "cluster-manager/hub/registration/webhook-serviceaccount.yaml", // work-webhook - "cluster-manager/hub/cluster-manager-work-webhook-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-work-webhook-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-work-webhook-serviceaccount.yaml", + "cluster-manager/hub/work/webhook-clusterrole.yaml", + "cluster-manager/hub/work/webhook-clusterrolebinding.yaml", + "cluster-manager/hub/work/webhook-serviceaccount.yaml", // work executor admin - "cluster-manager/hub/cluster-manager-work-executor-admin-clusterrole.yaml", + "cluster-manager/hub/work/executor-admin-clusterrole.yaml", // placement - "cluster-manager/hub/cluster-manager-placement-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-placement-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-placement-serviceaccount.yaml", + "cluster-manager/hub/placement/clusterrole.yaml", + "cluster-manager/hub/placement/clusterrolebinding.yaml", + "cluster-manager/hub/placement/serviceaccount.yaml", } mwReplicaSetResourceFiles = []string{ // manifestworkreplicaset - "cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-manifestworkreplicaset-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-manifestworkreplicaset-serviceaccount.yaml", + "cluster-manager/hub/manifestworkreplicaset/clusterrole.yaml", + "cluster-manager/hub/manifestworkreplicaset/clusterrolebinding.yaml", + "cluster-manager/hub/manifestworkreplicaset/serviceaccount.yaml", } hubAddOnManagerRbacResourceFiles = []string{ // addon-manager - "cluster-manager/hub/cluster-manager-addon-manager-clusterrole.yaml", - "cluster-manager/hub/cluster-manager-addon-manager-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-addon-manager-work-executor-admin-clusterrolebinding.yaml", - "cluster-manager/hub/cluster-manager-addon-manager-serviceaccount.yaml", + "cluster-manager/hub/addon-manager/clusterrole.yaml", + "cluster-manager/hub/addon-manager/clusterrolebinding.yaml", + "cluster-manager/hub/addon-manager/work-executor-admin-clusterrolebinding.yaml", + "cluster-manager/hub/addon-manager/serviceaccount.yaml", } // The hubHostedWebhookServiceFiles should only be deployed on the hub cluster when the deploy mode is hosted. hubDefaultWebhookServiceFiles = []string{ - "cluster-manager/hub/cluster-manager-registration-webhook-service.yaml", - "cluster-manager/hub/cluster-manager-work-webhook-service.yaml", + "cluster-manager/hub/registration/webhook-service.yaml", + "cluster-manager/hub/work/webhook-service.yaml", } hubHostedWebhookServiceFiles = []string{ - "cluster-manager/hub/cluster-manager-registration-webhook-service-hosted.yaml", - "cluster-manager/hub/cluster-manager-work-webhook-service-hosted.yaml", + "cluster-manager/hub/registration/webhook-service-hosted.yaml", + "cluster-manager/hub/work/webhook-service-hosted.yaml", } // hubHostedWebhookEndpointFiles only apply when the deploy mode is hosted and address is IPFormat. - hubHostedWebhookEndpointRegistration = "cluster-manager/hub/cluster-manager-registration-webhook-endpoint-hosted.yaml" - hubHostedWebhookEndpointWork = "cluster-manager/hub/cluster-manager-work-webhook-endpoint-hosted.yaml" + hubHostedWebhookEndpointRegistration = "cluster-manager/hub/registration/webhook-endpoint-hosted.yaml" + hubHostedWebhookEndpointWork = "cluster-manager/hub/work/webhook-endpoint-hosted.yaml" grpcServerResourceFiles = []string{ "cluster-manager/hub/grpc-server/clusterrole.yaml", diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_runtime_reconcile.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_runtime_reconcile.go index 2e604e319..9006b6d68 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_runtime_reconcile.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_runtime_reconcile.go @@ -28,22 +28,22 @@ import ( var ( // All deployments should be deployed in the management cluster. deploymentFiles = []string{ - "cluster-manager/management/cluster-manager-registration-deployment.yaml", - "cluster-manager/management/cluster-manager-registration-webhook-deployment.yaml", - "cluster-manager/management/cluster-manager-work-webhook-deployment.yaml", - "cluster-manager/management/cluster-manager-placement-deployment.yaml", + "cluster-manager/management/registration/deployment.yaml", + "cluster-manager/management/registration/webhook-deployment.yaml", + "cluster-manager/management/work/webhook-deployment.yaml", + "cluster-manager/management/placement/deployment.yaml", } addOnManagerDeploymentFiles = []string{ - "cluster-manager/management/cluster-manager-addon-manager-deployment.yaml", + "cluster-manager/management/addon-manager/deployment.yaml", } mwReplicaSetDeploymentFiles = []string{ - "cluster-manager/management/cluster-manager-manifestworkreplicaset-deployment.yaml", + "cluster-manager/management/manifestworkreplicaset/deployment.yaml", } grpcServerDeploymentFiles = []string{ - "cluster-manager/management/cluster-manager-grpc-server-deployment.yaml", + "cluster-manager/management/grpc-server/deployment.yaml", } ) diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_webhook_reconcile.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_webhook_reconcile.go index 887e2c180..a93e23615 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_webhook_reconcile.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_webhook_reconcile.go @@ -27,12 +27,12 @@ var ( // The hubWebhookResourceFiles should be deployed in the hub cluster // The service should may point to a external url which represent the webhook-server's address. hubRegistrationWebhookResourceFiles = []string{ - "cluster-manager/hub/cluster-manager-registration-webhook-validatingconfiguration.yaml", - "cluster-manager/hub/cluster-manager-registration-webhook-mutatingconfiguration.yaml", - "cluster-manager/hub/cluster-manager-registration-webhook-clustersetbinding-validatingconfiguration.yaml", + "cluster-manager/hub/registration/webhook-validatingconfiguration.yaml", + "cluster-manager/hub/registration/webhook-mutatingconfiguration.yaml", + "cluster-manager/hub/registration/webhook-clustersetbinding-validatingconfiguration.yaml", } hubWorkWebhookResourceFiles = []string{ - "cluster-manager/hub/cluster-manager-work-webhook-validatingconfiguration.yaml", + "cluster-manager/hub/work/webhook-validatingconfiguration.yaml", } )