# Code generated by KubeVela templates. DO NOT EDIT.
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  name: config
spec:
  status:
    customStatus: |-
      message: parameter.kind + ":" + context.outputs["\(parameter.configname)"].metadata.name
  appliesToWorkloads:
    - deployments.apps
  podDisruptive: true
  schematic:
    cue:
      template: |-
        outputs: "\(parameter.configname)": {
        	if parameter.kind == "configMap" {
        		apiVersion: "v1"
        		kind:       "ConfigMap"
        		metadata: name: parameter.name
        		data: {
        			for k, v in parameter.data {
        				"\(k)": v
        			}
        		}
        	}

        	if parameter.kind == "secret" {
        		apiVersion: "v1"
        		kind:       "Secret"
        		metadata: name: parameter.name
        		data: {
        			for k, v in parameter.data {
        				"\(k)": v
        			}
        		}
        	}
        }
        parameter: {
        	kind:       string
        	name:       string
        	configname: string
        	data: [string]: string
        }
        
