Added `helm` release updates. Fixes #32545. (#32593)

pull/32943/head
Wojciech Knapik 7 years ago committed by Ryan Brown
parent 86dc3c09ac
commit 115f6f6732

@ -115,14 +115,19 @@ def install(module, tserver):
namespace = module.params['namespace'] namespace = module.params['namespace']
chartb = chartbuilder.ChartBuilder(chart) chartb = chartbuilder.ChartBuilder(chart)
try: r_matches = (x for x in tserver.list_releases()
if x.name == name and x.namespace == namespace)
installed_release = next(r_matches, None)
if installed_release:
if installed_release.chart.metadata.version != chart['version']:
tserver.update_release(chartb.get_helm_chart(), False,
namespace, name=name, values=values)
changed = True
else:
tserver.install_release(chartb.get_helm_chart(), namespace, tserver.install_release(chartb.get_helm_chart(), namespace,
dry_run=False, name=name, dry_run=False, name=name,
values=values) values=values)
changed = True changed = True
except grpc._channel._Rendezvous as exc:
if "already exists" not in str(exc):
raise exc
return dict(changed=changed) return dict(changed=changed)

Loading…
Cancel
Save