diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 01a6be33f..0433214d2 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -79,6 +79,22 @@ jobs: # print existing client auth kubectl -n rook-ceph exec $toolbox -- ceph auth ls + - name: test re-running of external script should result in same output + 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 | tee output1.txt + kubectl -n rook-ceph exec $toolbox -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name=replicapool | tee output2.txt + if cmp output1.txt output2.txt; then + echo "files have same output" + rm output1.txt + rm output2.txt + else + echo "re-run with same flags changed the output, result in failure" + rm output1.txt + rm output2.txt + exit 1 + fi + - name: dry run external script create-external-cluster-resources.py 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 fbc5b2c28..148f7d68b 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1162,7 +1162,7 @@ class RadosJSON: # check if user already exist user_key = self.check_user_exist(entity) if user_key != "": - return user_key, f"{entity.split('.', 1)[1]}" + return user_key ret_val, json_out, err_msg = self._common_cmd_json_gen(cmd_json) # if there is an unsuccessful attempt,