Skip to content

Commit

Permalink
ceph: provide storageclass-es if there are valid parameters
Browse files Browse the repository at this point in the history
'ceph-rgw' storageclass will be provided only if 'rgw_endpoint' exists
'cephfs' storageclass will be provided only if ceph-fs and/or data-pool
parameters are valid.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
(cherry picked from commit cba605a)
  • Loading branch information
aruniiird authored and mergify-bot committed Aug 3, 2020
1 parent 6121a65 commit 87a0538
Showing 1 changed file with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,21 +481,6 @@ def gen_json_out(self):
"pool": self.out_map['RBD_POOL_NAME']
}
},
{
"name": "cephfs",
"kind": "StorageClass",
"data": {
"fsName": self.out_map['CEPHFS_FS_NAME'],
"pool": self.out_map['CEPHFS_POOL_NAME']
}
},
{
"name": "ceph-rgw",
"kind": "StorageClass",
"data": {
"endpoint": self.out_map['RGW_ENDPOINT']
}
},
{
"name": "monitoring-endpoint",
"kind": "CephCluster",
Expand All @@ -505,6 +490,27 @@ def gen_json_out(self):
}
}
]
# if 'CEPHFS_FS_NAME' exists, then only add 'cephfs' StorageClass
if self.out_map['CEPHFS_FS_NAME']:
json_out.append(
{
"name": "cephfs",
"kind": "StorageClass",
"data": {
"fsName": self.out_map['CEPHFS_FS_NAME'],
"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):
Expand Down

0 comments on commit 87a0538

Please sign in to comment.