Feat: add cluster in read or apply object (#2560)

(cherry picked from commit 5dbd8c8765)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
This commit is contained in:
github-actions[bot]
2021-10-27 10:08:29 +08:00
committed by GitHub
co-authored by FogDong
parent 24970cd990
commit b53f4f4fdd
8 changed files with 53 additions and 18 deletions
@@ -16,7 +16,13 @@ spec:
)
apply: op.#Apply & {
value: parameter
value: parameter.value
cluster: parameter.cluster
}
parameter: {
// +usage=Specify the value of the object
value: {...}
// +usage=Specify the cluster of the object
cluster: *"" | string
}
parameter: {}
@@ -28,6 +28,7 @@ spec:
}
}
}
cluster: parameter.cluster
}
}
if parameter.apiVersion != _|_ || parameter.kind != _|_ {
@@ -42,6 +43,7 @@ spec:
}
}
}
cluster: parameter.cluster
}
}
}
@@ -54,5 +56,7 @@ spec:
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
cluster: *"" | string
}
@@ -16,7 +16,13 @@ spec:
)
apply: op.#Apply & {
value: parameter
value: parameter.value
cluster: parameter.cluster
}
parameter: {
// +usage=Specify the value of the object
value: {...}
// +usage=Specify the cluster of the object
cluster: *"" | string
}
parameter: {}
@@ -28,6 +28,7 @@ spec:
}
}
}
cluster: parameter.cluster
}
}
if parameter.apiVersion != _|_ || parameter.kind != _|_ {
@@ -42,6 +43,7 @@ spec:
}
}
}
cluster: parameter.cluster
}
}
}
@@ -54,5 +56,7 @@ spec:
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
cluster: *"" | string
}
+15 -12
View File
@@ -21,18 +21,21 @@ spec:
- name: apply-pvc
type: apply-object
properties:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: standard
value:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: standard
# for multi-cluster
# cluster: my-cluster
- name: apply-server
type: apply-component
properties:
@@ -23,6 +23,8 @@ spec:
apiVersion: v1
kind: ConfigMap
name: my-cm-name
# for multi cluster
# cluster: my-cluster
- name: apply
type: apply-component
inputs:
@@ -10,7 +10,13 @@ import (
}
template: {
apply: op.#Apply & {
value: parameter
value: parameter.value
cluster: parameter.cluster
}
parameter: {
// +usage=Specify the value of the object
value: {...}
// +usage=Specify the cluster of the object
cluster: *"" | string
}
parameter: {}
}
@@ -22,6 +22,7 @@ template: {
}
}
}
cluster: parameter.cluster
}
}
if parameter.apiVersion != _|_ || parameter.kind != _|_ {
@@ -36,6 +37,7 @@ template: {
}
}
}
cluster: parameter.cluster
}
}
}
@@ -48,5 +50,7 @@ template: {
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
cluster: *"" | string
}
}