Enable to update Lables for cluster template
This patch enables to update Labels for cluster template. This patch should be cherry-picked into stable/queens. Change-Id: Ie1bfcca8e7a8fd848972d082effff24b21ea3795 Closes-Bug: #1638863
This commit is contained in:
parent
d78285db9d
commit
49a16f3ea0
|
@ -80,10 +80,6 @@ def _create_patches(old, new):
|
|||
patch = []
|
||||
|
||||
for key in new:
|
||||
if key == 'labels':
|
||||
# NOTE(shu-mutou): labels for cluster template and cluster
|
||||
# are not updatable.
|
||||
continue
|
||||
path = '/' + key
|
||||
if key in old and old[key] != new[key]:
|
||||
if new[key] is None or new[key] is '':
|
||||
|
@ -95,14 +91,14 @@ def _create_patches(old, new):
|
|||
patch.append({'op': 'add', 'path': path, 'value': new[key]})
|
||||
|
||||
for key in old:
|
||||
if key == 'labels':
|
||||
# NOTE(shu-mutou): labels for cluster template and cluster
|
||||
# are not updatable.
|
||||
continue
|
||||
path = '/' + key
|
||||
if key not in new:
|
||||
patch.append({'op': 'remove', 'path': path})
|
||||
|
||||
# convert dict value for labels into string
|
||||
for p in patch:
|
||||
if 'value' in p:
|
||||
p['value'] = str(p['value'])
|
||||
return patch
|
||||
|
||||
|
||||
|
|
|
@ -441,9 +441,7 @@
|
|||
htmlClass: 'col-xs-12',
|
||||
items: [
|
||||
{
|
||||
key: 'labels',
|
||||
// fixme: to be available, needs to fix bug/1638863
|
||||
readonly: action === 'update'
|
||||
key: 'labels'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue