velaux
velaux copied to clipboard
Cannot add multiple traits, such as init-containers or sidecars
I successfully added multiple traits of init-container in yaml:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: busybox
spec:
components:
- name: busybox
type: webservice
properties:
image: busybox
cmd: ["sleep", "86400"]
traits:
- type: init-container
properties:
name: init-busybox
image: busybox
cmd: ["sh", "-c"]
args:
- |
echo hello > /data/hello.text
mountName: "init-data"
initMountPath: /data
appMountPath: /data-initialized
- type: init-container
properties:
name: init-busybox-2
image: busybox
cmd: ["sh", "-c"]
args:
- |
echo hello > /data/hello2.text
mountName: "init-data-2"
initMountPath: /data
appMountPath: **/data-initialized-2**
but adding multiple init-containers in velaux failed, get error prompt: "trait is already exist". I think adding multiple traits of init-containers or sidecars to a component is a normal requirement, why not support it.
Yes, it's just not supported in velaux, you can send a PR for this feature.