Skip to content

Update image

If you have the following valid podman yaml, there will be no update of the defined container image:

apiVersion: v1
kind: Pod
metadata:
  name: mycontainertest
spec:
  containers:
    - env:
        - name: ADDR
          value: 127.0.0.1:8080
      image: registry.git.autistici.org/ai3/docker/static-content:latest
      name: mywebserver
      volumeMounts:
        - mountPath: /var/www
          name: data-app
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
      ports:
        - containerPort: 8080
          hostPort: 8080
          protocol: TCP
  volumes:
    - hostPath:
        path: /data/app
        type: Directory
      name: data-app

In the https://code.immerda.ch/immerda/puppet-modules/podman/-/blob/master/files/pod_image_update.sh we use a regex, that will not catch the images in this config. This config use six spaces instead of four spaces to intend the image definition.