Skip to content

Commit

Permalink
Fixes problem in case of get_helm_json_output failed
Browse files Browse the repository at this point in the history
with traceback 'CallProcessError'

It should return empty dictionary

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Oct 24, 2024
1 parent 5cc3b29 commit a6b71cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion container_ci_suite/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ def helm_package(self) -> bool:
return False

def get_helm_json_output(self, command: str) -> Dict:
output = HelmChartsAPI.run_helm_command(cmd=command)
try:
output = HelmChartsAPI.run_helm_command(cmd=command)
except subprocess.CalledProcessError as cpe:
print(f"Helm command {command} failed. See {cpe.output}")
return {}
# Remove debug wrong output
new_output = []
for line in output.split('\n'):
Expand Down Expand Up @@ -235,6 +239,8 @@ def helm_installation(self, values: Dict = None):
)
# Let's wait couple seconds, till it is not really imported
time.sleep(3)
if not json_output:
return False
assert json_output["name"] == self.package_name
assert json_output["chart"]["metadata"]["version"] == self.version
assert json_output["info"]["status"] == "deployed"
Expand Down

0 comments on commit a6b71cc

Please sign in to comment.