Skip to content

Commit 35d6c37

Browse files
authored
Merge branch 'main' into irgeek/fix-team-permissions
2 parents cc172cc + 5bd9c6c commit 35d6c37

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Below is a brief overview of the tools available in this repository:
1414
| [honeytoken-tools](./honeytoken-tools) | Script to disseminate honeytokens in your repositories via Pull Requests |
1515
| [team-mapping-github-gitguardian](./team-mapping-github-gitguardian) | An example script using the GitHub and GitGuardian APIs to map GitHub Teams and the repositories they own to GitGuardian Teams and their perimeters. |
1616
| [team-mapping-gitlab-gitguardian](./team-mapping-gitlab-gitguardian) | An example script using the Gitlab and GitGuardian APIs to map Gitlab Groups and the repositories they own to GitGuardian Teams and their perimeters. |
17-
| [secret-key-rotation](./secret-key-rotation) | Rotate the Database Encrytion Secret Key. |
17+
| [secret-key-rotation](./secret-key-rotation) | Rotate the Database Encryption Secret Key. |

helm-preflights/preflights.sh

Lines changed: 15 additions & 3 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
@@ -423,7 +435,7 @@ then
423435
echo -e "If this step is too long, please check the pod is running in the accurate namespace"
424436
echo -e "Please wait ..."
425437
#Start job
426-
run_hide_output "kubectl create job $NAMESPACE --from=cronjob/$REMOTE_CRONJOB_NAME $REMOTE_CRONJOB_NAME-`mktemp -u XXXXX | tr '[:upper:]' '[:lower:]'` --dry-run=client -o json | jq 'del(.metadata.ownerReferences)' | kubectl apply -f -" "all"
438+
run_hide_output "kubectl create job $NAMESPACE --from=cronjob/$REMOTE_CRONJOB_NAME $REMOTE_CRONJOB_NAME-`mktemp -u XXXXXX | tr '[:upper:]' '[:lower:]'` --dry-run=client -o json | jq 'del(.metadata.ownerReferences)' | kubectl apply -f -" "all"
427439
sleep 5
428440
pod=$(kubectl get pods $NAMESPACE -l gitguardian=remote-preflight --sort-by=.metadata.creationTimestamp -o 'jsonpath={.items[-1].metadata.name}')
429441

@@ -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)