You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
Investigate the library PyHelm to replace the "helm" commands launched from Python using subprocess.
Could be cleaner to handle credentials to access helm in the cluster.
Maybe we can reduce the complexity of unit-testing using this library.
Adding the third party library we may reduce the maintenance load, make the code more clear to handle using only python code and not having to assemble cli commands, and what is expected from the api call could be more reliable.
Reduce the error handling special characters and how we are escaping them.
if show_command:
print(t.magenta(command))
try:
# TODO: Can we do this with a different command than check_output (Bandit security issue)
result = check_output(command, stderr=STDOUT, shell=True)
decoded = result.decode("utf-8")
if verbose:
print(decoded)
return decoded, None
except CalledProcessError as e:
error_text = e.output.decode("utf-8")
if show_errors:
print(t.red("Command failed with CalledProcessError:"))
print(error_text)
return None, error_text
Aha, PyHelm appears to be relatively young project. I agree that it is worth looking into it, and agree that getting rid of as many subprocess calls as possible, would be helpful.
And anything that reduces the Unit Test complexity without sacrificing functionality is worthwhile.
Investigate the library PyHelm to replace the "helm" commands launched from Python using subprocess.
Module documentation: https://pypi.org/project/pyhelm/
Example of how we execute:
This could help to fix #26
The text was updated successfully, but these errors were encountered: