From 8b59879f1b22dc3cb19b5b3e6da8bf3969a247b2 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Tue, 18 Jun 2024 20:26:52 +0530 Subject: [PATCH] external: create a configmap for the command line args user can look back to there configurations by looking at the configmap created with command line arguments This will be useful for them during upgrades when they need to re run the python script with the same flags Signed-off-by: parth-gr --- deploy/examples/create-external-cluster-resources.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index e0ccbcaf94966..2bca2d7c48c45 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1528,6 +1528,9 @@ def init_topology_rbd_pools(self, topology_rbd_pools): for pool in topology_rbd_pools: self.init_rbd_pool(pool) + def getCommand(self): + return " ".join(sys.argv) + def _gen_output_map(self): if self.out_map: return @@ -1542,6 +1545,7 @@ def _gen_output_map(self): self.validate_rados_namespace() self._excluded_keys.add("K8S_CLUSTER_NAME") self.get_cephfs_data_pool_details() + self.out_map["EXTERNAL_CLUSTER_USER_COMMAND"] = self.getCommand() self.out_map["NAMESPACE"] = self._arg_parser.namespace self.out_map["K8S_CLUSTER_NAME"] = self._arg_parser.k8s_cluster_name self.out_map["ROOK_EXTERNAL_FSID"] = self.get_fsid() @@ -1702,6 +1706,13 @@ def gen_json_out(self): if self._arg_parser.dry_run: return "" json_out = [ + { + "name": "external-cluster-user-command", + "kind": "ConfigMap", + "data": { + "data": self.out_map["EXTERNAL_CLUSTER_USER_COMMAND"], + }, + }, { "name": "rook-ceph-mon-endpoints", "kind": "ConfigMap",