Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache authored and masayag committed Mar 12, 2024
1 parent a6fada0 commit c15bf47
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
37 changes: 33 additions & 4 deletions charts/workflows/charts/move2kube/templates/01-sonataflow_m2k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
- name: createNotification
operation: notifications#createNotification
type: rest
- name: increasePlanRetries
operation: .planRetries=.planRetries + 1
type: expression
start:
stateName: StartPlanning
states:
Expand All @@ -60,8 +63,14 @@ spec:
refName: startPlanning
name: StartPlanning
transition:
nextState: GetPlanning
nextState: InitGetPlanningRetry
type: operation
- data:
planRetries: 0
name: InitGetPlanningRetry
transition:
nextState: GetPlanning
type: inject
- actionMode: sequential
actions:
- actionDataFilter:
Expand All @@ -76,13 +85,27 @@ spec:
sleep:
before: PT2S
name: GetPlanning
transition:
nextState: IncreaseGetPlanningRetry
type: operation
- actionMode: sequential
actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: increasePlanRetries
name: IncreaseGetPlanningRetry
transition:
nextState: PlanRetrievedCheck
type: operation
- dataConditions:
- condition: (has("plan") and .plan != "")
transition:
nextState: StartTransformation
- condition: (.planRetries > ($SECRET.move2kube_get_plan_max_retries | tonumber))
transition:
nextState: GetPlanRetryExceededError
defaultCondition:
transition:
nextState: GetPlanning
Expand Down Expand Up @@ -169,13 +192,19 @@ spec:
transition:
nextState: PrintExitErrorMessage
type: inject
- data:
exitMessage: '"Get plan retries exceeded, an error probably occurred, check the move2kube instance logs"'
name: GetPlanRetryExceededError
transition:
nextState: PrintExitErrorMessage
type: inject
- branches:
- actions:
- actionDataFilter:
useResults: true
functionRef:
arguments:
message: '${"m2k workflow: " + $WORKFLOW.instanceId + " has finalized with error. Exit message: " + .exitMessage + " -- Context: " + .error }'
message: '${"m2k workflow: " + $WORKFLOW.instanceId + " has finalized with error. Exit message: " + .exitMessage + " -- Plan retries: " + (.planRetries|tostring) + " -- Context: " + .error }'
invoke: sync
refName: systemOut
name: printSystemOut
Expand All @@ -186,7 +215,7 @@ spec:
condition: ((has("notificationsDisabled") and .notificationsDisabled != null and .notificationsDisabled == true)|not)
functionRef:
arguments:
message: '"Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed with exit message: "+ .exitMessage + "\n\nError: " + .error'
message: '"Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed with exit message: "+ .exitMessage + " -- Plan retries: " + (.planRetries|tostring) + " -- Error: " + .error'
origin: Move2Kube Workflow
title: '"Move2Kube workflow " + $WORKFLOW.instanceId + " failed"'
topic: Move2Kube Workflow
Expand Down Expand Up @@ -234,7 +263,7 @@ spec:
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-move2kube:461344f60b29fe64958b0041641a33d764c0771c
image: quay.io/orchestrator/serverless-workflow-move2kube:8d27f0eae1b9060585fa73f82d8caa75a891024f
resources:
configMaps:
- configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data:
# This property is used when sending the notification while waiting for Q&A
move2kube_url=${MOVE2KUBE_URL:http://move2kube-svc.default.svc.cluster.local:8080}
move2kube_get_plan_max_retries=${MOVE2KUBE_GET_PLAN_MAX_RETRIES:10}
# This property is used to send requests to the move2kube instance
quarkus.rest-client.move2kube_yaml.url=${MOVE2KUBE_URL:http://move2kube-svc.default.svc.cluster.local:8080}
# This property is used to send requests to the backstage notification plugin
Expand Down

0 comments on commit c15bf47

Please sign in to comment.