Fix: fix depends on app built-in step (#2429)

This commit is contained in:
Tianxin Dong
2021-10-09 18:48:53 +08:00
committed by GitHub
parent f70133e5e6
commit f06980c5f4
4 changed files with 52 additions and 34 deletions

View File

@@ -27,7 +27,7 @@ spec:
}
}
load: op.#Steps & {
if dependsOn.err != _|_ {
if dependsOn.err != _|_ && dependsOn.value == _|_ {
configMap: op.#Read & {
value: {
apiVersion: "v1"
@@ -43,18 +43,16 @@ spec:
yaml.Unmarshal(configMap.value.data[parameter.name])
}
}
}
if dependsOn.err == _|_ {
apply: op.#Apply & {
value: {
dependsOn.value
}
wait: op.#ConditionalWait & {
continue: load.apply.value.status.status == "running"
}
}
if dependsOn.value != _|_ {
wait: op.#ConditionalWait & {
continue: dependsOn.value.status.status == "running"
}
}
}
phase: load.apply.value.status.status
wait: op.#ConditionalWait & {
continue: phase == "running"
}
parameter: {
// +usage=Specify the name of the dependent Application

View File

@@ -27,7 +27,7 @@ spec:
}
}
load: op.#Steps & {
if dependsOn.err != _|_ {
if dependsOn.err != _|_ && dependsOn.value == _|_ {
configMap: op.#Read & {
value: {
apiVersion: "v1"
@@ -43,18 +43,16 @@ spec:
yaml.Unmarshal(configMap.value.data[parameter.name])
}
}
}
if dependsOn.err == _|_ {
apply: op.#Apply & {
value: {
dependsOn.value
}
wait: op.#ConditionalWait & {
continue: load.apply.value.status.status == "running"
}
}
if dependsOn.value != _|_ {
wait: op.#ConditionalWait & {
continue: dependsOn.value.status.status == "running"
}
}
}
phase: load.apply.value.status.status
wait: op.#ConditionalWait & {
continue: phase == "running"
}
parameter: {
// +usage=Specify the name of the dependent Application

View File

@@ -0,0 +1,26 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: kruise
namespace: vela-system
spec:
components:
- name: kruise
type: helm
properties:
branch: master
chart: ./charts/kruise/v0.9.0
version: "*"
repoType: git
url: https://github.com/openkruise/kruise
workflow:
steps:
- name: check-flux
type: depends-on-app
properties:
name: fluxcd
namespace: vela-system
- name: apply-kruise
type: apply-component
properties:
component: kruise

View File

@@ -23,7 +23,7 @@ template: {
}
load: op.#Steps & {
if dependsOn.err != _|_ {
if dependsOn.err != _|_ && dependsOn.value == _|_ {
configMap: op.#Read & {
value: {
apiVersion: "v1"
@@ -39,20 +39,16 @@ template: {
yaml.Unmarshal(configMap.value.data[parameter.name])
}
}
}
if dependsOn.err == _|_ {
apply: op.#Apply & {
value: {
dependsOn.value
}
wait: op.#ConditionalWait & {
continue: load.apply.value.status.status == "running"
}
}
}
phase: load.apply.value.status.status
wait: op.#ConditionalWait & {
continue: phase == "running"
if dependsOn.value != _|_ {
wait: op.#ConditionalWait & {
continue: dependsOn.value.status.status == "running"
}
}
}
parameter: {