Skip to content

Commit

Permalink
external: create a configmap for the command line args
Browse files Browse the repository at this point in the history
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 <partharora1010@gmail.com>
  • Loading branch information
parth-gr committed Jun 20, 2024
1 parent e9b4c08 commit 8b59879
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deploy/examples/create-external-cluster-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 8b59879

Please sign in to comment.