mirror of
https://github.com/kubevela/kubevela.git
synced 2026-03-05 19:22:03 +00:00
* add:show & install caps in default center and docs other things: * fix #1601 (.md) error * adjust clean-md.py * refactor capability install part to reuse code * fix typo/bug, make get retrieve single file * try again * add:registry interface * add local registry * modify e2e test * add copyright * add unittest, fix docs * add copyright * fix e2e test * clean up testdata * clean up usage of fmt, rename * fix docs, rename func * fix docs
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
annotations:
|
|
definition.oam.dev/description: "add an init container with a shared volume."
|
|
name: init-container
|
|
namespace: vela-system
|
|
spec:
|
|
appliesToWorkloads:
|
|
- webservice
|
|
- worker
|
|
schematic:
|
|
cue:
|
|
template: |-
|
|
patch: {
|
|
spec: template: spec: {
|
|
// +patchKey=name
|
|
containers: [{
|
|
name: context.name
|
|
// +patchKey=name
|
|
volumeMounts: [{
|
|
name: parameter.mountName
|
|
mountPath: parameter.appMountPath
|
|
}]
|
|
}]
|
|
initContainers: [{
|
|
name: parameter.name
|
|
image: parameter.image
|
|
command: parameter.command
|
|
// +patchKey=name
|
|
volumeMounts: [{
|
|
name: parameter.mountName
|
|
mountPath: parameter.initMountPath
|
|
}]
|
|
}]
|
|
// +patchKey=name
|
|
volumes: [{
|
|
name: parameter.mountName
|
|
emptyDir: {}
|
|
}]
|
|
}
|
|
}
|
|
|
|
parameter: {
|
|
name: string
|
|
image: string
|
|
command?: [...string]
|
|
mountName: *"workdir" | string
|
|
appMountPath: string
|
|
initMountPath: string
|
|
}
|