mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-06 17:37:09 +00:00
34 lines
826 B
YAML
34 lines
826 B
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
annotations:
|
|
definition.oam.dev/description: "dynamically specify service account"
|
|
name: dynamic-sa
|
|
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
|
|
}
|