mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Changing ceph details to a dictionary. Original code would actually explode if ceph didn't exist :-/
This commit is contained in:
parent
1bb4263de6
commit
967d4b7a94
@ -683,12 +683,14 @@ def configure_cdk_addons():
|
|||||||
cephEnabled = "true"
|
cephEnabled = "true"
|
||||||
else:
|
else:
|
||||||
cephEnabled = "false"
|
cephEnabled = "false"
|
||||||
ceph = endpoint_from_flag('ceph-storage.available')
|
ceph_ep = endpoint_from_flag('ceph-storage.available')
|
||||||
if ceph:
|
ceph = {}
|
||||||
b64_ceph_key = base64.b64encode(ceph.key().encode('utf-8'))
|
default_storage = ''
|
||||||
ceph_admin_key = b64_ceph_key.decode('ascii')
|
if ceph_ep:
|
||||||
ceph_kubernetes_key = b64_ceph_key.decode('ascii')
|
b64_ceph_key = base64.b64encode(ceph_ep.key().encode('utf-8'))
|
||||||
ceph_mon_hosts = ceph.mon_hosts()
|
ceph['admin_key'] = b64_ceph_key.decode('ascii')
|
||||||
|
ceph['kubernetes_key'] = b64_ceph_key.decode('ascii')
|
||||||
|
ceph['mon_hosts'] = ceph_ep.mon_hosts()
|
||||||
default_storage = hookenv.config('default-storage')
|
default_storage = hookenv.config('default-storage')
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
@ -700,10 +702,10 @@ def configure_cdk_addons():
|
|||||||
'enable-metrics=' + metricsEnabled,
|
'enable-metrics=' + metricsEnabled,
|
||||||
'enable-gpu=' + str(gpuEnable).lower(),
|
'enable-gpu=' + str(gpuEnable).lower(),
|
||||||
'enable-ceph=' + cephEnabled,
|
'enable-ceph=' + cephEnabled,
|
||||||
'ceph-admin-key=' + (ceph_admin_key or ''),
|
'ceph-admin-key=' + (ceph.get('admin_key', '')),
|
||||||
'ceph-kubernetes-key=' + (ceph_admin_key or ''),
|
'ceph-kubernetes-key=' + (ceph.get('admin_key', '')),
|
||||||
'ceph-mon-hosts="' + (ceph_mon_hosts or '') + '"',
|
'ceph-mon-hosts="' + (ceph.get('mon_hosts', '')) + '"',
|
||||||
'default-storage=' + (default_storage or ''),
|
'default-storage=' + default_storage,
|
||||||
]
|
]
|
||||||
check_call(['snap', 'set', 'cdk-addons'] + args)
|
check_call(['snap', 'set', 'cdk-addons'] + args)
|
||||||
if not addons_ready():
|
if not addons_ready():
|
||||||
|
Loading…
Reference in New Issue
Block a user