mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-16 14:27:00 +00:00
* add podDisruptive to traitdefinition * fix docs & example * fix diff and add docs * use bool type for podDisruptive Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
31 lines
814 B
YAML
31 lines
814 B
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
annotations:
|
|
definition.oam.dev/description: "Add virtual group labels"
|
|
name: virtualgroup
|
|
namespace: vela-system
|
|
spec:
|
|
appliesToWorkloads:
|
|
- webservice
|
|
- worker
|
|
podDisruptive: false
|
|
schematic:
|
|
cue:
|
|
template: |-
|
|
patch: {
|
|
spec: template: {
|
|
metadata: labels: {
|
|
if parameter.type == "namespace" {
|
|
"app.namespace.virtual.group": parameter.group
|
|
}
|
|
if parameter.type == "cluster" {
|
|
"app.cluster.virtual.group": parameter.group
|
|
}
|
|
}
|
|
}
|
|
}
|
|
parameter: {
|
|
group: *"default" | string
|
|
type: *"namespace" | string
|
|
} |