velaux icon indicating copy to clipboard operation
velaux copied to clipboard

Cannot add multiple traits, such as init-containers or sidecars

Open huaxk opened this issue 1 year ago • 1 comments

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.

huaxk avatar May 29 '23 02:05 huaxk

Yes, it's just not supported in velaux, you can send a PR for this feature.

wonderflow avatar Jun 29 '23 05:06 wonderflow