Skip to content

Commit 41ee982

Browse files
Fix typo, exit(1) in case of failures
1 parent 4220cee commit 41ee982

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/release/kubectl-mongodb/python/build_kubectl_plugin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
GORELEASER_DIST_DIR = "dist"
2121

22-
# LOCAL_KUBECTL_PLUGIN_PATH the full filename where tests image expects the kuebctl-mongodb binary to be available
22+
# LOCAL_KUBECTL_PLUGIN_PATH is the full filename where tests image expects the kuebctl-mongodb binary to be available
2323
LOCAL_KUBECTL_PLUGIN_PATH = "docker/mongodb-kubernetes-tests/multi-cluster-kube-config-creator_linux"
2424

2525

@@ -81,6 +81,7 @@ def upload_artifacts_to_s3(s3_bucket: str, version: str):
8181
uploaded_files += 1
8282
except Exception as e:
8383
logger.debug(f"ERROR: Failed to upload file {filename}: {e}")
84+
sys.exit(1)
8485

8586
if uploaded_files > 0:
8687
logger.info(f"Successfully uploaded {uploaded_files} kubectl-mongodb plugin artifacts to S3.")
@@ -101,7 +102,7 @@ def download_plugin_for_tests_image(build_scenario: BuildScenario, s3_bucket: st
101102
s3_client = boto3.client("s3", region_name=AWS_REGION)
102103
except Exception as e:
103104
logger.debug(f"An error occurred connecting to S3 to download kubectl plugin for tests image: {e}")
104-
return
105+
sys.exit(1)
105106

106107
plugin_path = f"{S3_BUCKET_KUBECTL_PLUGIN_SUBPATH}/{version}/dist/kubectl-mongodb_linux_amd64_v1/kubectl-mongodb"
107108

@@ -117,8 +118,10 @@ def download_plugin_for_tests_image(build_scenario: BuildScenario, s3_bucket: st
117118
logger.debug(f"ERROR: Artifact not found at s3://{s3_bucket}/{plugin_path} ")
118119
else:
119120
logger.debug(f"ERROR: Failed to download artifact. S3 Client Error: {e}")
121+
sys.exit(1)
120122
except Exception as e:
121123
logger.debug(f"An unexpected error occurred during download: {e}")
124+
sys.exit(1)
122125

123126

124127
def main():

0 commit comments

Comments
 (0)