github.com/oam-dev/kubevela@v1.9.11/e2e/plugin/testdata/dynamic-sa.yaml (about) 1 apiVersion: core.oam.dev/v1beta1 2 kind: TraitDefinition 3 metadata: 4 annotations: 5 definition.oam.dev/description: "dynamically specify service account" 6 name: dynamic-sa 7 spec: 8 appliesToWorkloads: 9 - deployments.apps 10 schematic: 11 cue: 12 template: |- 13 processing: { 14 output: { 15 credentials?: string 16 } 17 http: { 18 method: *"GET" | string 19 url: parameter.serviceURL 20 request: { 21 header: { 22 "authorization.token": parameter.uidtoken 23 } 24 } 25 } 26 } 27 patch: { 28 spec: template: spec: serviceAccountName: processing.output.credentials 29 } 30 parameter: { 31 uidtoken: string 32 serviceURL: string 33 }