diff options
Diffstat (limited to 'helm/plugin')
-rw-r--r-- | helm/plugin/tasks.py | 19 | ||||
-rw-r--r-- | helm/plugin/workflows.py | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/helm/plugin/tasks.py b/helm/plugin/tasks.py index 3374e94..7cb9147 100644 --- a/helm/plugin/tasks.py +++ b/helm/plugin/tasks.py @@ -368,3 +368,22 @@ def rollback(**kwargs): retry_after=5) get_current_helm_value(chartName) get_helm_history(chartName) + +@operation +def status(**kwargs): + componentName = ctx.node.properties['component-name'] + namespace = ctx.node.properties['namespace'] + + chartName = namespace + "-" + componentName + statusCommand = 'helm status ' + chartName + tiller_host() + tls() + output = execute_command(statusCommand) + if output == False: + return ctx.operation.retry( + message='helm status failed, re-try after 5 second ', + retry_after=5) + + status_output = [line.strip() for line in output.split('\n') if + line.strip()] + for index in range(len(status_output)): + status_output[index] = status_output[index].replace('\t', ' ') + ctx.instance.runtime_properties['install-status'] = status_output diff --git a/helm/plugin/workflows.py b/helm/plugin/workflows.py index 2999b73..de5549d 100644 --- a/helm/plugin/workflows.py +++ b/helm/plugin/workflows.py @@ -83,3 +83,13 @@ def rollback(node_instance_id, revision, **kwargs): operation_args = {'operation': 'rollback', } operation_args['kwargs'] = kwargs node_instance.execute_operation(**operation_args) + +@workflow +def status(**kwargs): + + for node in ctx.nodes: + for node_instance in node.instances: + kwargs = {} + operation_args = {'operation': 'status', } + operation_args['kwargs'] = kwargs + node_instance.execute_operation(**operation_args) |