From b645c2d0b551e3db6c98ab8b32cc620cd264fd8b Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Wed, 30 Oct 2024 14:37:35 +0000 Subject: [PATCH] Automated PR from https://github.com/parodos-dev/serverless-workflows/pull/481 --- charts/mtv-migration/Chart.yaml | 2 +- ...ap_01-mtv-migration-resources-schemas.yaml | 13 ++++++++++ .../04-sonataflow_mtv-migration.yaml | 24 +++++++++++++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/charts/mtv-migration/Chart.yaml b/charts/mtv-migration/Chart.yaml index 1af0b4a5..abf54d8d 100644 --- a/charts/mtv-migration/Chart.yaml +++ b/charts/mtv-migration/Chart.yaml @@ -6,7 +6,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.0-rc3 +version: 1.3.0-rc4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/mtv-migration/templates/02-configmap_01-mtv-migration-resources-schemas.yaml b/charts/mtv-migration/templates/02-configmap_01-mtv-migration-resources-schemas.yaml index 7b467409..cc26e6af 100755 --- a/charts/mtv-migration/templates/02-configmap_01-mtv-migration-resources-schemas.yaml +++ b/charts/mtv-migration/templates/02-configmap_01-mtv-migration-resources-schemas.yaml @@ -28,6 +28,19 @@ data: "recipients" ] } + workflow-output-schema.json: |- + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } + } kind: ConfigMap metadata: creationTimestamp: null diff --git a/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml b/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml index 565bb6df..53ec2c16 100755 --- a/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml +++ b/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml @@ -31,6 +31,12 @@ spec: - name: getMigrationError operation: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical" or .type == "Failed"))[0].message type: expression + - name: successResult + operation: '{ "completedWith":"success", "message": "MTV migration " + .migrationName + " succeeded", "outputs":[] }' + type: expression + - name: errorResult + operation: '{ "completedWith":"error", "message": "MTV migration " + .migrationName + " failed.", "outputs":[ { "key":"Error", "value": .migrationErrorMessage } ] }' + type: expression start: stateName: CreateMigration states: @@ -112,11 +118,15 @@ spec: invoke: sync refName: createNotification name: createNotification + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorResult + name: setOutput end: terminate: true name: MigrationFailure - stateDataFilter: - output: '{migrationError: .migrationErrorMessage}' type: operation - actionMode: sequential actions: @@ -135,16 +145,20 @@ spec: invoke: sync refName: createNotification name: createNotification + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput end: terminate: true name: MigrationSuccessful - stateDataFilter: - output: '{migrationSuccessful: "migration successful"}' type: operation podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-mtv-migration:579ccba10961697faa471493e9038d7e6682fc0d + image: quay.io/orchestrator/serverless-workflow-mtv-migration:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c envFrom: - secretRef: name: mtv-migration-creds