diff options
-rw-r--r-- | test/security/check_versions/src/k8s_bin_versions_inspector.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/security/check_versions/src/k8s_bin_versions_inspector.py b/test/security/check_versions/src/k8s_bin_versions_inspector.py index e5a59b923..d576dd767 100644 --- a/test/security/check_versions/src/k8s_bin_versions_inspector.py +++ b/test/security/check_versions/src/k8s_bin_versions_inspector.py @@ -305,13 +305,17 @@ def sync_post_namespaced_pod_exec( # TODO: Is there really no better way, to check # execution exit code in python k8s API client? - code = ( - 0 - if error["status"] == "Success" - else -2 - if error["reason"] != "NonZeroExitCode" - else int(error["details"]["causes"][0]["message"]) - ) + code=-2 + try: + code = ( + 0 + if error["status"] == "Success" + else -2 + if error["reason"] != "NonZeroExitCode" + else int(error["details"]["causes"][0]["message"]) + ) + except: + pass return { "stdout": stdout, |