-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I am trying to use initContainers in a RunnerDeployment spec. However, once applied, it appears that the initContainers value are overwritten to an empty value, which then results in this error:
ERROR controller-runtime.controller Reconciler error {"controller": "runner-controller", "request": "actions-runners/test-rf9v5-kjks5", "error": "Runner.actions.summerwind.dev \"test-rf9v5-kjks5\" is invalid: spec.initContainers.name: Required value"}
Checks
- My actions-runner-controller version (v0.19.0) does support the feature
- I'm using an unreleased version of the controller I built from HEAD of the default branch
To Reproduce
Steps to reproduce the behavior:
- Apply the following
RunnerDeploymentspec:
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: test
namespace: actions-runners
spec:
replicas: 1
template:
metadata: {}
spec:
dockerdWithinRunnerContainer: true
ephemeral: true
image: summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04
initContainers:
- command:
- sh
- '-c'
- 'echo "I just want to run..."'
image: 'alpine'
name: test
labels:
- test
repository: test/test- Describe the created
RunnerDeploymentand notice that theinitContainersnow have a single empty value:
$ k get runnerdeployments.actions.summerwind.dev test -n actions-runners -oyaml
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"actions.summerwind.dev/v1alpha1","kind":"RunnerDeployment","metadata":{"annotations":{},"name":"test","namespace":"actions-runners"},"spec":{"replicas":1,"template":{"metadata":{},"spec":{"dockerdWithinRunnerContainer":true,"ephemeral":true,"image":"summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04","initContainers":[{"command":["sh","-c","echo \"I just want to run...\""],"image":"alpine","name":"test"}],"labels":["test"],"repository":"test/test"}}}}
creationTimestamp: "2021-08-28T09:40:18Z"
generation: 1
name: test
namespace: actions-runners
resourceVersion: "7900359"
uid: a39eed1b-8edc-4da5-b6e8-9577586ba0cc
spec:
replicas: 1
selector: null
template:
metadata: {}
spec:
dockerdContainerResources: {}
dockerdWithinRunnerContainer: true
ephemeral: true
image: summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04
initContainers:
- {}
labels:
- test
repository: test/test
resources: {}Expected behavior
The initContainers are applied to the runner Pod as defined in the RunnerDeployment
Environment (please complete the following information):
- Controller Version
v0.19.0 - Deployment Method
Helm - Helm Chart Version
0.12.7
Additional context
Just to try rule out the possibility that other controllers/mutating webhooks were mutating the RunnerDeployment I tested with a simple Pod spec with initContainers but that worked as expected.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working