external: honour support of cluster-name legacy flag

we have changed the --cluster-name flag to --k8s-cluster-name
but to support automation while upgrade we should support
the legacy flag

Signed-off-by: parth-gr <partharora1010@gmail.com>
This commit is contained in:
parth-gr committed 2024-01-09 21:20:16 +05:30
1 parent 1935033a1e
commit 8e4ec01cbb
2 files changed
+14 -1

No files matched your search

@@ -54,7 +54,7 @@ jobs:
run: tests/scripts/github-action-helper.sh deploy_cluster
- name: setup csi-addons
run: tests/scripts/csiaddons.sh setup_csiaddons
run: tests/scripts/csiaddons.sh setup_csiaddons
- name: wait for prepare pod
run: tests/scripts/github-action-helper.sh wait_for_prepare_pod 2
@@ -162,6 +162,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}')
@@ -323,6 +323,11 @@ class RadosJSON:
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"
)
@@ -1508,6 +1513,9 @@ class RadosJSON:
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