diff --git a/charts/create-ocp-project/Chart.yaml b/charts/create-ocp-project/Chart.yaml index 7799d06b..75e50bdd 100644 --- a/charts/create-ocp-project/Chart.yaml +++ b/charts/create-ocp-project/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/create-ocp-project/templates/02-configmap_01-create-ocp-project-resources-schemas.yaml b/charts/create-ocp-project/templates/02-configmap_01-create-ocp-project-resources-schemas.yaml index 8e75d514..80289b24 100755 --- a/charts/create-ocp-project/templates/02-configmap_01-create-ocp-project-resources-schemas.yaml +++ b/charts/create-ocp-project/templates/02-configmap_01-create-ocp-project-resources-schemas.yaml @@ -44,6 +44,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/create-ocp-project/templates/04-sonataflow_create-ocp-project.yaml b/charts/create-ocp-project/templates/04-sonataflow_create-ocp-project.yaml index 6510ea3d..4360f1f5 100755 --- a/charts/create-ocp-project/templates/04-sonataflow_create-ocp-project.yaml +++ b/charts/create-ocp-project/templates/04-sonataflow_create-ocp-project.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Creating an OpenShift Project sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -41,6 +41,15 @@ spec: - name: print operation: sysout type: custom + - name: successResult + operation: '{ "completedWith":"success", "message": "Project " + .projectName + " active", "outputs":[] }' + type: expression + - name: errorProjectNotActiveResult + operation: '{ "completedWith":"error", "message": "Project " + .projectName + " not active" }' + type: expression + - name: errorAuthorizationDeniedResult + operation: '{ "completedWith":"error", "message": "Creation of project " + .projectName + " denied", "outputs":[ { "key":"Jira issue", "value": $SECRET.jira_url + "/jira/servicedesk/projects/" + .operationsProjectKey + "/issues/" + .operationsJiraCreateIssueResult.key, "format":"link" }] }' + type: expression start: stateName: '[Audit]: workflow started' states: @@ -210,6 +219,12 @@ spec: invoke: sync refName: createNotification name: 'Create notification: project active' + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput name: Notify project active transition: nextState: '[Audit]: Close issue on Jira' @@ -231,6 +246,12 @@ spec: invoke: sync refName: createNotification name: 'Create notification: project not active' + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorProjectNotActiveResult + name: setOutput name: Notify project not active transition: nextState: '[Audit]: Close issue on Jira' @@ -267,6 +288,12 @@ spec: type: operation - actionMode: sequential actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorAuthorizationDeniedResult + name: setOutput - actionDataFilter: toStateData: .jiraGetTransitionResult useResults: true @@ -298,7 +325,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-create-ocp-project:579ccba10961697faa471493e9038d7e6682fc0d + image: quay.io/orchestrator/serverless-workflow-create-ocp-project:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c envFrom: - secretRef: name: create-ocp-project-creds diff --git a/charts/extendable-workflow/Chart.yaml b/charts/extendable-workflow/Chart.yaml index fffd1ade..a6ebb876 100644 --- a/charts/extendable-workflow/Chart.yaml +++ b/charts/extendable-workflow/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-rc2 +version: 1.3.0-rc3 # 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/extendable-workflow/templates/02-configmap_01-extendable-workflow-resources-schemas.yaml b/charts/extendable-workflow/templates/02-configmap_01-extendable-workflow-resources-schemas.yaml index 151da4e5..81f6d0a8 100755 --- a/charts/extendable-workflow/templates/02-configmap_01-extendable-workflow-resources-schemas.yaml +++ b/charts/extendable-workflow/templates/02-configmap_01-extendable-workflow-resources-schemas.yaml @@ -52,6 +52,19 @@ data: "required": ["personalInfo", "languageInfo"] } + 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/extendable-workflow/templates/03-sonataflow_extendable-workflow.yaml b/charts/extendable-workflow/templates/03-sonataflow_extendable-workflow.yaml index 1e3cc898..3a0146b3 100755 --- a/charts/extendable-workflow/templates/03-sonataflow_extendable-workflow.yaml +++ b/charts/extendable-workflow/templates/03-sonataflow_extendable-workflow.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: YAML based extendable-workflow workflow sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -31,6 +31,9 @@ spec: - name: GreetInFrench operation: '{ greeting: "Bienvenue " + .personalInfo.firstName + " " + .personalInfo.lastName + " du merveilleux pays de " + .personalInfo.country + " ! Vos mots de passes sont bien reçus: " + .personalInfo.password + " et ils correspondent: " + .personalInfo.confirmPassword + "... Il serait bon de les changer maintenant." }' type: expression + - name: successResult + operation: '{ "completedWith":"success", "message": "Extendable workflow completed successfully", "outputs":[ { "key":"Selected language", "value": .languageInfo.language }, { "key":"Greeting message", "value": .greeting } ] }' + type: expression start: stateName: ChooseOnLanguage states: @@ -91,6 +94,12 @@ spec: invoke: sync refName: greetFunction name: greetAction + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput end: terminate: true name: GreetPerson @@ -98,7 +107,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-extendable-workflow:7c4866215908760015ded6d848d32cf937a2ca98 + image: quay.io/orchestrator/serverless-workflow-extendable-workflow:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c resources: configMaps: - configMap: diff --git a/charts/greeting/Chart.yaml b/charts/greeting/Chart.yaml index 0586fdc5..1d38627a 100644 --- a/charts/greeting/Chart.yaml +++ b/charts/greeting/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-rc5 +version: 1.3.0-rc6 # 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/greeting/templates/02-configmap_01-greeting-resources-schemas.yaml b/charts/greeting/templates/02-configmap_01-greeting-resources-schemas.yaml index 6763b1e3..f9ba09ed 100755 --- a/charts/greeting/templates/02-configmap_01-greeting-resources-schemas.yaml +++ b/charts/greeting/templates/02-configmap_01-greeting-resources-schemas.yaml @@ -14,6 +14,19 @@ data: } } } + 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/greeting/templates/03-sonataflow_greeting.yaml b/charts/greeting/templates/03-sonataflow_greeting.yaml index 86a8794c..c1b67913 100755 --- a/charts/greeting/templates/03-sonataflow_greeting.yaml +++ b/charts/greeting/templates/03-sonataflow_greeting.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: YAML based greeting workflow sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -22,6 +22,9 @@ spec: - name: greetFunction operation: sysout type: custom + - name: successResult + operation: '{ "completedWith":"success", "message": "Greeting workflow completed successfully", "outputs":[ { "key":"Selected language", "value": .language }, { "key":"Greeting message", "value": .greeting } ] }' + type: expression start: stateName: ChooseOnLanguage states: @@ -59,6 +62,12 @@ spec: invoke: sync refName: greetFunction name: greetAction + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput end: terminate: true name: GreetPerson @@ -66,7 +75,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-greeting:c3b7031d91ae42fa423d1d25060e50dc6267031c + image: quay.io/orchestrator/serverless-workflow-greeting:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c resources: configMaps: - configMap: diff --git a/charts/modify-vm-resources/Chart.yaml b/charts/modify-vm-resources/Chart.yaml index eb45678f..869c0a04 100644 --- a/charts/modify-vm-resources/Chart.yaml +++ b/charts/modify-vm-resources/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/modify-vm-resources/templates/02-configmap_01-modify-vm-resources-resources-schemas.yaml b/charts/modify-vm-resources/templates/02-configmap_01-modify-vm-resources-resources-schemas.yaml index 7b4ea9ce..8573391c 100755 --- a/charts/modify-vm-resources/templates/02-configmap_01-modify-vm-resources-resources-schemas.yaml +++ b/charts/modify-vm-resources/templates/02-configmap_01-modify-vm-resources-resources-schemas.yaml @@ -71,6 +71,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/modify-vm-resources/templates/04-sonataflow_modify-vm-resources.yaml b/charts/modify-vm-resources/templates/04-sonataflow_modify-vm-resources.yaml index 323a2eaf..66effc6f 100755 --- a/charts/modify-vm-resources/templates/04-sonataflow_modify-vm-resources.yaml +++ b/charts/modify-vm-resources/templates/04-sonataflow_modify-vm-resources.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Modify VM Resources (Memory/CPU) sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -41,6 +41,15 @@ spec: - name: fillEmptyValues operation: '{ vm_new_memory:(if (.vm_new_memory == null or .vm_new_memory =="") then .vm.spec.template.spec.domain.memory.guest else .vm_new_memory end), vm_new_cpu_cores:(if .vm_new_cpu_cores == null then .vm.spec.template.spec.domain.cpu.cores else .vm_new_cpu_cores end), vm_new_cpu_sockets:(if .vm_new_cpu_sockets == null then .vm.spec.template.spec.domain.cpu.sockets else .vm_new_cpu_sockets end), vm_new_cpu_threads:if .vm_new_cpu_threads == null then .vm.spec.template.spec.domain.cpu.threads else .vm_new_cpu_threads end }' type: expression + - name: successResult + operation: '{ "completedWith":"success", "message": "VM" + .vm_name + " in namespace " + .vm_namespace + " updated.", "outputs":[ { "key":"Console URL", "value": $SECRET.cluster_console_url + "/k8s/ns/" + .vm_namespace + "/kubevirt.io~v1~VirtualMachine/" + .vm_name + "/console/standalone", "format":"link" } ] }' + type: expression + - name: errorVMNotRunningResult + operation: '{ "completedWith":"error", "message": "VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" + .vmStatusRunningRetries + " times: " + .vm.status }' + type: expression + - name: errorAuthorizationDeniedResult + operation: '{ "completedWith":"error", "message": "Authorization denied to update VM " + .vm_name + " in namespace " + .vm_namespace + ". Memory: " + .vm_new_memory + ". CPU cores: " + (.vm_new_cpu_cores|tostring) + ". CPU threads: " + (.vm_new_cpu_threads|tostring) + ". CPU sockets: " + (.vm_new_cpu_sockets|tostring), "outputs":[ { "key":"Jira issue", "value": $SECRET.jira_url + "/jira/servicedesk/projects/" + .projectKey + "/issues/" + .jiraCreateIssueResult.key, "format":"link" }] }' + type: expression start: stateName: Get VM states: @@ -314,6 +323,14 @@ spec: refName: createNotification name: 'Create notification: VM update running' name: 'Create notification: VM running' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -337,7 +354,7 @@ spec: functionRef: arguments: payload: - description: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" +.vmStatusRunningRetries+" times: " + .vm.status' + description: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready after the update after checking" + .vmStatusRunningRetries + " times: " + .vm.status' severity: high title: '"VM" + .vm_name + " in namespace " + .vm_namespace + " not ready"' topic: Modify VM Resources workflow @@ -348,6 +365,14 @@ spec: refName: createNotification name: 'Create notification: VM update not running' name: 'Create notification: VM not running' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorVMNotRunningResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -383,6 +408,14 @@ spec: refName: createNotification name: 'Create notification: VM update denied' name: 'Create notification: VM update denied' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorAuthorizationDeniedResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -392,7 +425,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-modify-vm-resources:579ccba10961697faa471493e9038d7e6682fc0d + image: quay.io/orchestrator/serverless-workflow-modify-vm-resources:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c envFrom: - secretRef: name: modify-vm-resources-creds diff --git a/charts/move2kube/Chart.yaml b/charts/move2kube/Chart.yaml index 05965317..8058cf6f 100644 --- a/charts/move2kube/Chart.yaml +++ b/charts/move2kube/Chart.yaml @@ -15,7 +15,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-rc5 # 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/move2kube/templates/02-configmap_01-m2k-resources-schemas.yaml b/charts/move2kube/templates/02-configmap_01-m2k-resources-schemas.yaml index fe7f23bf..b85dfd5f 100755 --- a/charts/move2kube/templates/02-configmap_01-m2k-resources-schemas.yaml +++ b/charts/move2kube/templates/02-configmap_01-m2k-resources-schemas.yaml @@ -52,6 +52,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/move2kube/templates/04-sonataflow_m2k.yaml b/charts/move2kube/templates/04-sonataflow_m2k.yaml index 07ec2bdc..188f7c58 100755 --- a/charts/move2kube/templates/04-sonataflow_m2k.yaml +++ b/charts/move2kube/templates/04-sonataflow_m2k.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Workflow to execute Move2Kube sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -53,6 +53,12 @@ spec: - name: formatTransformationErrorExitMessage operation: '{ exitMessage: "Error while saving transformation output: " + (if .error == null then "timeout exception was thrown." else .error end) }' type: expression + - name: successResult + operation: '{ "completedWith":"success", "message": "Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " was successful; the output is available in the branch " + .targetBranch + " of your git repository "+ .repositoryURL, "outputs": [ { "key":"Git repository", "value": .repositoryURL, "format":"link" }, { "key":"Git branch", "value": .targetBranch } ] }' + type: expression + - name: errorResult + operation: '{ "completedWith":"error", "message": "Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed ", "outputs":[ { "key":"Exit message", "value": .exitMessage }, { "key":"Plan retries", "value": (.planRetries|tostring), "format":"number" } ] }' + type: expression start: stateName: StartPlanning states: @@ -238,6 +244,14 @@ spec: refName: createNotification name: createNotification name: createNotification + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -272,6 +286,14 @@ spec: refName: createNotification name: createNotification name: createNotification + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -281,7 +303,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-move2kube:579ccba10961697faa471493e9038d7e6682fc0d + image: quay.io/orchestrator/serverless-workflow-move2kube:f376e50f271ae3fedd4dd460429a8bc35a790ca4 envFrom: - secretRef: name: m2k-creds diff --git a/charts/move2kube/values.yaml b/charts/move2kube/values.yaml index 1c944578..b9d940b0 100644 --- a/charts/move2kube/values.yaml +++ b/charts/move2kube/values.yaml @@ -7,7 +7,7 @@ workflow: backstageNotificationURL: http://orchestrator-backstage.orchestrator:7007/api/notifications/ # URL for backstage notification plugin kfunction: name: m2k-save-transformation-func # name of the Knative function that save the transformation output to git - image: quay.io/orchestrator/serverless-workflow-m2k-kfunc:579ccba10961697faa471493e9038d7e6682fc0d # image of the knative function + image: quay.io/orchestrator/serverless-workflow-m2k-kfunc:f376e50f271ae3fedd4dd460429a8bc35a790ca4 # image of the knative function instance: name: move2kube # name of the move2kube instance deployment image: quay.io/konveyor/move2kube-ui:v0.3.14 # image of the move2kube instance diff --git a/charts/mta-v6.x/templates/04-sonataflow_mta-analysis-v6.yaml b/charts/mta-v6.x/templates/04-sonataflow_mta-analysis-v6.yaml index d21fbfe0..ebd77067 100755 --- a/charts/mta-v6.x/templates/04-sonataflow_mta-analysis-v6.yaml +++ b/charts/mta-v6.x/templates/04-sonataflow_mta-analysis-v6.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Workflow to execute MTA Analysis sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: diff --git a/charts/mta-v7.x/templates/04-sonataflow_mta-analysis-v7.yaml b/charts/mta-v7.x/templates/04-sonataflow_mta-analysis-v7.yaml index bcb847d0..26c0cfec 100755 --- a/charts/mta-v7.x/templates/04-sonataflow_mta-analysis-v7.yaml +++ b/charts/mta-v7.x/templates/04-sonataflow_mta-analysis-v7.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Workflow to execute MTA Analysis sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: diff --git a/charts/mta/templates/04-sonataflow_mtaanalysis.yaml b/charts/mta/templates/04-sonataflow_mtaanalysis.yaml index e668f8d4..6df47020 100755 --- a/charts/mta/templates/04-sonataflow_mtaanalysis.yaml +++ b/charts/mta/templates/04-sonataflow_mtaanalysis.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Workflow to execute MTA Analysis sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: 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 c8921512..53ec2c16 100755 --- a/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml +++ b/charts/mtv-migration/templates/04-sonataflow_mtv-migration.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: workflow executes a plan by creating a migration and waiting for it to be successful or failed sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -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 diff --git a/charts/mtv-plan/templates/04-sonataflow_mtv-plan.yaml b/charts/mtv-plan/templates/04-sonataflow_mtv-plan.yaml index 2bf2c048..1df78a7c 100755 --- a/charts/mtv-plan/templates/04-sonataflow_mtv-plan.yaml +++ b/charts/mtv-plan/templates/04-sonataflow_mtv-plan.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: assessment creates a plan and waits for it to be ready or failed sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: diff --git a/charts/request-vm-cnv/Chart.yaml b/charts/request-vm-cnv/Chart.yaml index dfcb7e0f..f7d34510 100644 --- a/charts/request-vm-cnv/Chart.yaml +++ b/charts/request-vm-cnv/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/request-vm-cnv/templates/02-configmap_01-request-vm-cnv-resources-schemas.yaml b/charts/request-vm-cnv/templates/02-configmap_01-request-vm-cnv-resources-schemas.yaml index 76834d1e..b7f94e1e 100755 --- a/charts/request-vm-cnv/templates/02-configmap_01-request-vm-cnv-resources-schemas.yaml +++ b/charts/request-vm-cnv/templates/02-configmap_01-request-vm-cnv-resources-schemas.yaml @@ -51,6 +51,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/request-vm-cnv/templates/04-sonataflow_request-vm-cnv.yaml b/charts/request-vm-cnv/templates/04-sonataflow_request-vm-cnv.yaml index 33dd7699..0584f9c4 100755 --- a/charts/request-vm-cnv/templates/04-sonataflow_request-vm-cnv.yaml +++ b/charts/request-vm-cnv/templates/04-sonataflow_request-vm-cnv.yaml @@ -4,7 +4,7 @@ metadata: annotations: sonataflow.org/description: Request VM on CNV sonataflow.org/expressionLang: jq - sonataflow.org/profile: prod + sonataflow.org/profile: gitops sonataflow.org/version: "1.0" creationTimestamp: null labels: @@ -38,6 +38,15 @@ spec: - name: increaseVMStatusRunningRetries operation: .vmStatusRunningRetries=.vmStatusRunningRetries + 1 type: expression + - name: successResult + operation: '{ "completedWith":"success", "message": "VM" + .vm_name + " in namespace "+.vm_namespace + " using image "+ .vm_image +" ready and running.", "outputs":[ { "key":"Console URL", "value": $SECRET.cluster_console_url + "/k8s/ns/" + .vm_namespace + "/kubevirt.io~v1~VirtualMachine/" + .vm_name + "/console/standalone", "format":"link" } ] }' + type: expression + - name: errorVMNotRunningResult + operation: '{ "completedWith":"error", "message": "VM" + .vm_name + " in namespace "+.vm_namespace + " using image "+ .vm_image +" not ready after "+ .vmStatusRunningRetries + " retries: " + .vm.status }' + type: expression + - name: errorAuthorizationDeniedResult + operation: '{ "completedWith":"error", "message": "Authorization denied to create VM" + .vm_name + " in namespace "+.vm_namespace + " using image "+ .vm_image, "outputs":[ { "key":"Jira issue", "value": $SECRET.jira_url + "/jira/servicedesk/projects/" + .projectKey + "/issues/" + .jiraCreateIssueResult.key, "format":"link" }] }' + type: expression start: stateName: Open issue on JIRA states: @@ -306,6 +315,14 @@ spec: refName: createNotification name: 'Create notification: VM creation running' name: 'Create notification: VM running' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -329,7 +346,7 @@ spec: functionRef: arguments: payload: - description: '"VM" + .vm_name + " in namespace "+.vm_namespace + " using image "+ .vm_image +" not ready after "+.vmStatusRunningRetries+" retries: " + .vm.status' + description: '"VM" + .vm_name + " in namespace "+.vm_namespace + " using image "+ .vm_image +" not ready after "+ .vmStatusRunningRetries + " retries: " + .vm.status' severity: high title: '"VM" + .vm_name + " in namespace "+.vm_namespace + " not ready"' topic: Request CM on CNV workflow @@ -340,6 +357,14 @@ spec: refName: createNotification name: 'Create notification: VM not running' name: 'Create notification: VM not running' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorVMNotRunningResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -375,6 +400,14 @@ spec: refName: createNotification name: 'Create notification: VM creation denied' name: 'Create notification: VM creation denied' + - actions: + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: errorAuthorizationDeniedResult + name: setOutput + name: setOutput completionType: allOf end: terminate: true @@ -384,7 +417,7 @@ spec: podTemplate: container: resources: {} - image: quay.io/orchestrator/serverless-workflow-request-vm-cnv:579ccba10961697faa471493e9038d7e6682fc0d + image: quay.io/orchestrator/serverless-workflow-request-vm-cnv:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c envFrom: - secretRef: name: request-vm-cnv-creds