Skip to content
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

feat/check and update fence jobs #2564

Merged
merged 9 commits into from
Jun 11, 2024
26 changes: 25 additions & 1 deletion gen3/bin/gitops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,34 @@ gen3_gitops_sync() {
gen3 job run etl --wait ETL_FORCED TRUE
fi

# update fence jobs
if [[ "$versions_roll" = true ]]; then
# List of fence-related cronjobs
local fence_cronjobs=("fence-delete-expired-clients" "fence-cleanup-expired-ga4gh-info")

# function to check and update cronjobs
update_cronjob() {
local cronjob_name=$1
gen3_log_info "Checking cronjob $cronjob_name..."
local cronjob_schedule=$(kubectl get cronjobs.batch $cronjob_name -o jsonpath='{.spec.schedule}')
if [[ -z "$cronjob_schedule" ]]; then
gen3_log_info "Cronjob $cronjob_name does not exist or has no schedule."
return
fi
gen3_log_info "Updating cronjob $cronjob_name ..."
gen3 job cron $cronjob_name "$cronjob_schedule"
}

# Loop through each fence-related cronjob and check/update if needed
for cronjob in "${fence_cronjobs[@]}"; do
update_cronjob "$cronjob"
done
fi

# update fence ConfigMap before roll-all
if [[ "$fence_roll" = true ]]; then
gen3 update_config manifest-fence "$(gen3 gitops folder)/manifests/fence/fence-config-public.yaml"
fi
fi

if [[ "$covid_cronjob_roll" = true ]]; then
if g3k_config_lookup '.global."covid19_data_bucket"'; then
Expand Down
Loading