Skip to content

Commit 5bd9c6c

Browse files
feat(preflights): add new option to keep local bundle, few fixes (#27)
Co-authored-by: Romain Jouhannet <[email protected]>
1 parent 99d8a03 commit 5bd9c6c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

helm-preflights/preflights.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ OPTIONS:
160160
--reuse
161161
Use existing templates if preflights have been played before
162162
163+
--save-local-preflights-output
164+
Save the local preflights output in the current directory
165+
163166
--nosave
164167
Do not save results in-cluster (not recommended)
165168
@@ -190,6 +193,7 @@ REMOTE_CHECKS="yes"
190193
VALUES_FILES=""
191194
FORCE="yes"
192195
SAVE="yes"
196+
SAVE_LOCAL_PREFLIGHTS_OUTPUT="no"
193197
DEBUG_MODE="no"
194198
INSTALL_JQ="no"
195199
INSTALL_HELM="no"
@@ -225,6 +229,10 @@ while (("$#")); do
225229
FORCE="no"
226230
shift
227231
;;
232+
--save-local-preflights-output)
233+
SAVE_LOCAL_PREFLIGHTS_OUTPUT="yes"
234+
shift
235+
;;
228236
--install-jq)
229237
INSTALL_JQ="yes"
230238
shift
@@ -387,11 +395,15 @@ then
387395
LOCAL_CHECKS_STATUS="error"
388396
exit_ko
389397
fi
398+
if [[ "$SAVE_LOCAL_PREFLIGHTS_OUTPUT" == "no" ]];
399+
then
400+
rm -f $script_dir/preflightbundle-*.tar.gz
401+
fi
390402
fi
391403

392404
if [[ "$REMOTE_CHECKS" == "yes" ]];
393405
then
394-
if ! run_hide_output "jq --version" "all";
406+
if ! jq --version &>/dev/null;
395407
then
396408
if [[ "$INSTALL_JQ" == "no" ]];
397409
then
@@ -456,7 +468,7 @@ then
456468
done
457469

458470
# Print preflights output
459-
output=`kubectl logs $NAMESPACE $pod`
471+
output=`kubectl logs $NAMESPACE $pod -c remote-preflight`
460472
echo -e "$output"
461473
GLOBAL_OUTPUT+="
462474
--- RUNNING REMOTE TESTS$output"

0 commit comments

Comments
 (0)