From e047834e52f24a03153b23908433f1c97462b1e2 Mon Sep 17 00:00:00 2001 From: Arun Kumar Mohan Date: Thu, 30 Jul 2020 20:09:50 +0530 Subject: [PATCH] ceph: Provide 'ceph-rgw' Storage class only if 'rgw_endpoint' exists Signed-off-by: Arun Kumar Mohan --- .../ceph/create-external-cluster-resources.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py b/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py index 104a434a2d5dc..4a8cd69d318c7 100644 --- a/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py +++ b/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py @@ -473,13 +473,6 @@ def gen_json_out(self): "pool": self.out_map['RBD_POOL_NAME'] } }, - { - "name": "ceph-rgw", - "kind": "StorageClass", - "data": { - "endpoint": self.out_map['RGW_ENDPOINT'] - } - }, { "name": "monitoring-endpoint", "kind": "CephCluster", @@ -500,6 +493,16 @@ def gen_json_out(self): "pool": self.out_map['CEPHFS_POOL_NAME'] } }) + # if 'RGW_ENDPOINT' exists, then only add 'ceph-rgw' StorageClass + if self.out_map['RGW_ENDPOINT']: + json_out.append( + { + "name": "ceph-rgw", + "kind": "StorageClass", + "data": { + "endpoint": self.out_map['RGW_ENDPOINT'] + } + }) return json.dumps(json_out)+LINESEP def main(self):