# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/virtualgroup.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: Add virtual group labels
  name: virtualgroup
  namespace: vela-system
spec:
  appliesToWorkloads:
    - deployments.apps
  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
        }

