diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 3f5d1b945980..c0ba6f631a2a 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -161,6 +161,11 @@ jobs: toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --k8s-cluster-name rookstorage --restricted-auth-permission true + - name: test external script with restricted_auth_permission flag and with --cluster-name legacy flag + run: | + toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool --cluster-name rookstorage --restricted-auth-permission true + - name: test external script with restricted_auth_permission flag run: | toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}') diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index 940c80ad2520..e6a846662828 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -323,6 +323,11 @@ def gen_arg_parser(cls, args_to_parse=None): type=str, help="Provides a user name to check the cluster's health status, must be prefixed by 'client.'", ) + common_group.add_argument( + "--cluster-name", + default="", + help="Kubernetes cluster name(legacy flag), Note: Either use this or --k8s-cluster-name", + ) common_group.add_argument( "--k8s-cluster-name", default="", help="Kubernetes cluster name" ) @@ -1463,6 +1468,9 @@ def validate_rgw_multisite(self, rgw_multisite_config_name, rgw_multisite_config def _gen_output_map(self): if self.out_map: return + # support legacy flag with upgrades + if self._arg_parser.cluster_name: + self._arg_parser.k8s_cluster_name = self._arg_parser.cluster_name self._arg_parser.k8s_cluster_name = ( self._arg_parser.k8s_cluster_name.lower() ) # always convert cluster name to lowercase characters