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):