Files
kubevela/docs/examples/registry/virtualgroup.yaml
yangsoon 1261e2678f add podDisruptive to traitdefinition (#1192)
* 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>
2021-04-08 13:39:03 +08:00

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
}