# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/dynamic-sa.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: dynamically specify service account
  name: dynamic-sa
  namespace: vela-system
spec:
  appliesToWorkloads:
    - deployments.apps
  schematic:
    cue:
      template: |
        processing: {
        	output: credentials?: string
        	http: {
        		method: *"GET" | string
        		url:    parameter.serviceURL
        		request: header: "authorization.token": parameter.uidtoken
        	}
        }
        patch: spec: template: spec: serviceAccountName: processing.output.credentials
        parameter: {
        	uidtoken:   string
        	serviceURL: string
        }

