From 2a95404f85932b763ddf21d61b7c49d399869756 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Wed, 2 Aug 2023 15:28:07 +0200 Subject: [PATCH] Document how to change the dev container image pull policy (#7014) ref https://github.com/redhat-developer/odo/issues/4494#issuecomment-1422448515 --- docs/website/docs/troubleshooting.md | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/website/docs/troubleshooting.md b/docs/website/docs/troubleshooting.md index 0a3433f9082..00283df1b97 100644 --- a/docs/website/docs/troubleshooting.md +++ b/docs/website/docs/troubleshooting.md @@ -92,12 +92,37 @@ $ odo preference set ImageRegistry quay.io/$USER - - [//]: # (## Devfile issues) ## Dev Sessions issues +### The Image Pull Policy of the dev container is `Always` and I cannot change it + +#### Description +When starting `odo dev`, the [image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) of the dev container is currently hardcoded to `Always`, +which may not be ideal for all platforms. + +#### Recommended Solution +The image pull policy can be changed by declaring a [`container-overrides`](https://devfile.io/docs/2.2.0/overriding-pod-and-container-attributes#container-overrides) attribute in the `container` component in the Devfile, like so: + +```yaml +components: +- name: runtime +# highlight-start + attributes: + container-overrides: + imagePullPolicy: IfNotPresent +# highlight-end + container: + command: ['tail'] + args: ['-f', '/dev/null'] + endpoints: + - name: http-node + targetPort: 3000 + image: registry.access.redhat.com/ubi8/nodejs-16:latest + mountSources: true +``` + ### I'm getting "Permission denied" errors when `odo dev` is syncing files #### Description