Skip to content

feat(preflights): add new option to keep local bundle, few fixes #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions helm-preflights/preflights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ OPTIONS:
--reuse
Use existing templates if preflights have been played before

--save-local-preflights-output
Save the local preflights output in the current directory

--nosave
Do not save results in-cluster (not recommended)

Expand Down Expand Up @@ -190,6 +193,7 @@ REMOTE_CHECKS="yes"
VALUES_FILES=""
FORCE="yes"
SAVE="yes"
SAVE_LOCAL_PREFLIGHTS_OUTPUT="no"
DEBUG_MODE="no"
INSTALL_JQ="no"
INSTALL_HELM="no"
Expand Down Expand Up @@ -225,6 +229,10 @@ while (("$#")); do
FORCE="no"
shift
;;
--save-local-preflights-output)
SAVE_LOCAL_PREFLIGHTS_OUTPUT="yes"
shift
;;
--install-jq)
INSTALL_JQ="yes"
shift
Expand Down Expand Up @@ -386,11 +394,15 @@ then
LOCAL_CHECKS_STATUS="error"
exit_ko
fi
if [[ "$SAVE_LOCAL_PREFLIGHTS_OUTPUT" == "no" ]];
then
rm -f $script_dir/preflightbundle-*.tar.gz
fi
fi

if [[ "$REMOTE_CHECKS" == "yes" ]];
then
if ! run_hide_output "jq --version" "all";
if ! jq --version &>/dev/null;
then
if [[ "$INSTALL_JQ" == "no" ]];
then
Expand Down Expand Up @@ -455,7 +467,7 @@ then
done

# Print preflights output
output=`kubectl logs $NAMESPACE $pod`
output=`kubectl logs $NAMESPACE $pod -c remote-preflight`
echo -e "$output"
GLOBAL_OUTPUT+="
--- RUNNING REMOTE TESTS$output"
Expand Down