snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Mounts of main container apply to all sidecars #440

Open snowdrop-bot opened 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

I have quarkus 2.3.1.Final, openshift extension and config application.properties:

quarkus.native.container-build=true
quarkus.container-image.build=true
quarkus.container-image.push=false
quarkus.container-image.builder=docker

quarkus.container-image.group=test-group
quarkus.container-image.name=test-name
quarkus.container-image.tag=latest

quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.mounts.main-volume1.path=/main-container/mount1
quarkus.openshift.mounts.main-volume2.path=/main-container/mount2

quarkus.openshift.sidecars.sidecar1.image=sidecar1-image
quarkus.openshift.sidecars.sidecar1.mounts.sidecar1-volume1.path=/sidecar1/mount1
quarkus.openshift.sidecars.sidecar1.mounts.sidecar1-volume2.path=/sidecar1/mount2

quarkus.openshift.sidecars.sidecar2.image=sidecar2-image
quarkus.openshift.sidecars.sidecar2.mounts.sidecar2-volume1.path=/sidecar2/mount1
quarkus.openshift.sidecars.sidecar2.mounts.sidecar2-volume2.path=/sidecar2/mount2

After mvnw -Pnative package generated openshift.yml contains mounts of main container in the all sidecars.

Expected behavior

        - image: sidecar1-image
          imagePullPolicy: IfNotPresent
          name: sidecar1
          volumeMounts:
            - mountPath: /sidecar1/mount1
              name: sidecar1-volume1
              readOnly: false
            - mountPath: /sidecar1/mount2
              name: sidecar1-volume2
              readOnly: false
        - image: sidecar2-image
          imagePullPolicy: IfNotPresent
          name: sidecar2
          volumeMounts:
            - mountPath: /sidecar2/mount1
              name: sidecar2-volume1
              readOnly: false
            - mountPath: /sidecar2/mount2
              name: sidecar2-volume2
              readOnly: false

Actual behavior

        - image: sidecar1-image
          imagePullPolicy: IfNotPresent
          name: sidecar1
          volumeMounts:
            - mountPath: /sidecar1/mount1
              name: sidecar1-volume1
              readOnly: false
            - mountPath: /sidecar1/mount2
              name: sidecar1-volume2
              readOnly: false
            - mountPath: /main-container/mount1
              name: main-volume1
              readOnly: false
            - mountPath: /main-container/mount2
              name: main-volume2
              readOnly: false
        - image: sidecar2-image
          imagePullPolicy: IfNotPresent
          name: sidecar2
          volumeMounts:
            - mountPath: /sidecar2/mount1
              name: sidecar2-volume1
              readOnly: false
            - mountPath: /sidecar2/mount2
              name: sidecar2-volume2
              readOnly: false
            - mountPath: /main-container/mount1
              name: main-volume1
              readOnly: false
            - mountPath: /main-container/mount2
              name: main-volume2
              readOnly: false

How to Reproduce?

Just add any mounts by quarkus.openshift.mounts."mounts".path and add config for sidecar by quarkus.openshift.sidecars."sidecar".image.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response


https://github.com/quarkusio/quarkus/issues/20987


$upstream:20987$