mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: read-object
|
|
namespace: vela-system
|
|
data:
|
|
template: |
|
|
import (
|
|
"vela/op"
|
|
)
|
|
|
|
output: {
|
|
if parameter.apiVersion == _|_ && parameter.kind == _|_ {
|
|
op.#Read & {
|
|
value: {
|
|
apiVersion: "core.oam.dev/v1beta1"
|
|
kind: "Application"
|
|
metadata: {
|
|
name: parameter.name
|
|
if parameter.namespace != _|_ {
|
|
namespace: parameter.namespace
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if parameter.apiVersion != _|_ || parameter.kind != _|_ {
|
|
op.#Read & {
|
|
value: {
|
|
apiVersion: parameter.apiVersion
|
|
kind: parameter.kind
|
|
metadata: {
|
|
name: parameter.name
|
|
if parameter.namespace != _|_ {
|
|
namespace: parameter.namespace
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
objStatus: {
|
|
output.value.status
|
|
}
|
|
parameter: {
|
|
// +usage=Specify the apiVersion of the object, defaults to core.oam.dev/v1beta1
|
|
apiVersion?: string
|
|
// +usage=Specify the kind of the object, defaults to Application
|
|
kind?: string
|
|
// +usage=Specify the name of the object
|
|
name: string
|
|
// +usage=Specify the namespace of the object
|
|
namespace?: string
|
|
}
|
|
|