Added possibility to get all values by helm_info module (#531)

Added possibility to get all values by helm_info module

SUMMARY
Parameter get_all_values has been added, which is passed to function get_values. Default is False. Parameter is not required.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
helm_info
ADDITIONAL INFORMATION
Unfortunately, helm_info module lacks functionality of getting all the values of a helm release, including the default ones. This restricts upgrade and config migration capabilities. Parameter get_all_values has been added. This parameter, if set, adds -a parameter to helm get values call. The parameter is not required and defaults to False, so backwards compability is complied.

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Bikouo Aubin <None>
This commit is contained in:
Fors1
2022-10-19 17:41:37 +02:00
committed by GitHub
parent 2092d921cd
commit 2a3862b67a
3 changed files with 22 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ def run_helm(module, command, fails_on_error=True):
return rc, out, err
def get_values(module, command, release_name):
def get_values(module, command, release_name, get_all=False):
"""
Get Values from deployed release
"""
@@ -86,6 +86,9 @@ def get_values(module, command, release_name):
get_command = command + " get values --output=yaml " + release_name
if get_all:
get_command += " -a"
rc, out, err = run_helm(module, get_command)
# Helm 3 return "null" string when no values are set
if out.rstrip("\n") == "null":