-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RunnerDeployment 'initContainers' getting overwritten #772
Comments
@donovanmuller Hey! Thanks for reporting. This does sound like a bug. But I'm not sure how it could happen in the current implementation. We only append InitContainers from the runner spec to the pod spec. And it should be sufficient and enough to make it work Do you have any insight on it? 🤔 |
@mumoshu agreed, I also couldn't see anything obvious that would overwrite I'll have to check the cluster audit logs to try see what is modifying the |
@mumoshu I've found the issue. This is because the You can test this by applying the $ cat /tmp/test-runner.yaml
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: test-runner
spec:
template:
spec:
dockerMTU: 9001
dockerdWithinRunnerContainer: true
ephemeral: true
image: 'summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04'
initContainers:
- name: copy-deps
command:
- sh
- '-c'
- echo "Hello"
image: apline
repository: test/test
$ kubectl apply -f https://raw.githubusercontent.com/actions-runner-controller/actions-runner-controller/ce48dc58e685d8bf48d369fe114434374aebc3c7/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml
Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
customresourcedefinition.apiextensions.k8s.io/runnerdeployments.actions.summerwind.dev created
$ kubectl apply -f /tmp/test-runner.yaml -n default
runnerdeployment.actions.summerwind.dev/test-runner created
$ kubectl get runnerdeployments.actions.summerwind.dev test-runner -n default -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-runner","namespace":"default"},"spec":{"template":{"spec":{"dockerMTU":9001,"dockerdWithinRunnerContainer":true,"ephemeral":true,"image":"summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04","initContainers":[{"command":["sh","-c","echo \"Hello\""],"image":"apline","name":"copy-deps"}],"repository":"test/test"}}}}
creationTimestamp: "2021-09-10T13:29:48Z"
generation: 1
name: test-runner
namespace: default
resourceVersion: "62817"
uid: d5e1252f-3487-465c-bac3-7587bb6ed6e3
spec:
template:
spec:
dockerMTU: 9001
dockerdWithinRunnerContainer: true
ephemeral: true
image: summerwind/actions-runner-dind:v2.278.0-ubuntu-20.04
initContainers:
- command:
- sh
- -c
- echo "Hello"
image: apline
name: copy-deps
repository: test/test
$ # delete the CRD, if you apply the new CRD it will add `preserveUnknownFields: true` when migrating from v1beta1 to v1
$ kubectl delete crd runnerdeployments.actions.summerwind.dev
customresourcedefinition.apiextensions.k8s.io "runnerdeployments.actions.summerwind.dev" deleted
$ kubectl apply -f https://raw.githubusercontent.com/actions-runner-controller/actions-runner-controller/master/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml
customresourcedefinition.apiextensions.k8s.io/runnerdeployments.actions.summerwind.dev created
$ kubectl apply -f /tmp/test-runner.yaml -n default
The RunnerDeployment "test-runner" is invalid: spec.template.spec.initContainers.name: Required value Where validation now fails because the |
This should be solved by #803 |
Describe the bug
I am trying to use
initContainers
in aRunnerDeployment
spec. However, once applied, it appears that theinitContainers
value are overwritten to an empty value, which then results in this error:Checks
To Reproduce
Steps to reproduce the behavior:
RunnerDeployment
spec:RunnerDeployment
and notice that theinitContainers
now have a single empty value:Expected behavior
The
initContainers
are applied to the runner Pod as defined in theRunnerDeployment
Environment (please complete the following information):
v0.19.0
Helm
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 simplePod
spec withinitContainers
but that worked as expected.The text was updated successfully, but these errors were encountered: