Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] sidecarset doesn't add volumes used by initContainers #934

Closed
outgnaY opened this issue Mar 21, 2022 · 0 comments · Fixed by #929
Closed

[BUG] sidecarset doesn't add volumes used by initContainers #934

outgnaY opened this issue Mar 21, 2022 · 0 comments · Fixed by #929
Assignees
Labels
kind/bug Something isn't working

Comments

@outgnaY
Copy link
Contributor

outgnaY commented Mar 21, 2022

What happened:
sidecarset doesn't add volumes used by initContainers, it will only add volumes used by sidecar containers instead, which cause
What you expected to happen:

How to reproduce it (as minimally and precisely as possible):
sidecarset.yaml

apiVersion: apps.kruise.io/v1alpha1
kind: SidecarSet
metadata:
  name: test-sidecarset
spec:
  selector:
    matchLabels:
      app: nginx
  updateStrategy:
    type: RollingUpdate
    maxUnavailable: 1
  initContainers:
  - name: init-container
    image: busybox:latest
    command: [ "/bin/sh", "-c", "sleep 10 && echo 'init container success'" ]
    volumeMounts:
    - name: log-volume
      mountPath: /var/log
  volumes: # this field will be merged into pod.spec.volumes
  - name: log-volume
    emptyDir: {}

pod.yaml

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: nginx
  name: pod-1
spec:
  containers:
    - name: busybox
      image: busybox
      command:
        - sleep
        - "3600"

-> kubectl apply -f pod.yaml
The Pod "nginx" is invalid: spec.initContainers[0].volumeMounts[0].name: Not found: "log-volume"
Anything else we need to know?:

Environment:

  • Kruise version:
  • Kubernetes version (use kubectl version):
  • Install details (e.g. helm install args):
  • Others:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants