Fix: step group documentation update and bug fix of firstExecuteTime not record (#4021)

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Fix: step group documentation update and bug fix of firstExecuteTime not record

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>
(cherry picked from commit 751dd181be)

Co-authored-by: Qiang Zheng <zhengq20018@cmbchina.com>
This commit is contained in:
github-actions[bot]
2022-05-27 11:50:58 +08:00
committed by GitHub
parent b35145be82
commit 371affb389
3 changed files with 36 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
# Step Group
## How to start
Edit a yaml file as `example.yaml`, then execute it with `vela up` command.
## Parameter Introduction
`step-group` has a `subSteps` parameter which is an array containing any step type whose valid parameters do not include the `step-group` step type itself.
`step-group` doesn't support `properties` for now.
## Execute process
When executing the `step-group` step, the subSteps in the step group are executed in dag mode. The step group will only complete when all subSteps have been executed to completion.
SubStep has the same execution behavior as a normal step.

View File

@@ -1,7 +1,7 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: step-group-example
name: example
namespace: default
spec:
components:
@@ -10,13 +10,22 @@ spec:
properties:
image: crccheck/hello-world
port: 8000
- name: express-server2
type: webservice
properties:
image: crccheck/hello-world
port: 8000
workflow:
steps:
- name: step
type: step-group
subSteps:
- name: apply-server
- name: apply-sub-step1
type: apply-component
properties:
component: express-server
- name: apply-sub-step2
type: apply-component
properties:
component: express-server2

View File

@@ -637,7 +637,8 @@ func (e *engine) updateStepStatus(status common.StepStatus) {
if index < 0 {
e.status.Steps = append(e.status.Steps, common.WorkflowStepStatus{
StepStatus: common.StepStatus{
Name: parentRunner,
Name: parentRunner,
FirstExecuteTime: now,
}})
index = len(e.status.Steps) - 1
}