Skip to content

Commit

Permalink
[minor] Add install sync point at the end of fvt-launcher (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
alequint authored Jun 3, 2024
1 parent b0fce77 commit 5875637
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion image/cli/app-root/src/wait-for-configmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ while [[ "$KEY_VALUE" == "" && "$RETRIES_USED" -le "$MAX_RETRIES" ]]; do
sleep $DELAY
KEY_VALUE=$(oc -n ${NAMESPACE} get configmap/${CONFIGMAP_NAME} -o jsonpath="{.data.${CONFIGMAP_KEY}}" 2> /dev/null)

if [[ "${KEY_VALUE}" != "" && -n "${ESCAPE_CONFIGMAP_NAME}" ]]; then
if [[ "${KEY_VALUE}" == "" && -n "${ESCAPE_CONFIGMAP_NAME}" ]]; then
# Check if the entire install pipeline has stopped so we can exit early
ESCAPE_VALUE=$(oc -n ${NAMESPACE} get configmap/${ESCAPE_CONFIGMAP_NAME} -o jsonpath="{.data.${ESCAPE_CONFIGMAP_KEY}}" 2> /dev/null)
if [[ "$ESCAPE_VALUE" != "" ]]; then
Expand Down
45 changes: 44 additions & 1 deletion tekton/src/pipelines/fvt-launcher.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,50 @@ spec:
values: ["true", "True"]
runAfter:
- launchfvt-visualinspection


# Last Sync Point
# -------------------------------------------------------------------------
# Guarantee installation pipeline ran till the end;
# In other words, guarantee sync-install pipeline has install_status key filled
#
# Note: this task will start once all the FVTs are approved and will start at the
# same time install's post-verify starts. It means its timeout must be higher than
# post-verify + sync-install, which will set the flag needed to finalize this fvt-launcher
# - Escape Route: none
# - Ignore Failures: false
# -------------------------------------------------------------------------
- name: waitfor-installation
taskRef:
kind: Task
name: mas-devops-wait-for-configmap
params:
- name: image_pull_policy
value: $(params.image_pull_policy)
- name: namespace
value: $(context.taskRun.namespace)
- name: configmap_name
value: sync-install
- name: configmap_key
value: INSTALL_STATUS
- name: configmap_target_value
value: Completed
# 25 retries at 5 minute intervals = 2 hours
- name: delay
value: "300"
- name: max_retries
value: "25"
- name: ignore_failure
value: "False"
when:
- input: $(params.sync_with_install)
operator: in
values: ["true", "True"]
runAfter:
- launchfvt-mobile
- approval-assist
- approval-optimizer
- approval-predict # Infers Manage, Monitor and IoT completed
- approval-visualinspection

finally:
# Collect must-gather
Expand Down

0 comments on commit 5875637

Please sign in to comment.