Back to lessons

Hosting Operations

Check Image Tags in Manifests

You need to confirm which container image tags are present in deployment manifests.

Command

grep -RhoE 'image:[[:space:]]*[^[:space:]]+' deploy/ | sort -u

What changed

Nothing changes. Matching image lines are printed.

Danger

safe

When to use it

Use before or after a deploy to confirm expected image references.

When not to use it

Do not rely on it if manifests are templated and the rendered output is the real source of truth.

Undo or recovery

No undo needed because this command is read-only.

Expected output

Unique image references such as image: registry.example/app:v1.2.3.

demo script

Disposable terminal steps

  1. cat deploy/app.yaml
  2. grep -RhoE 'image:[[:space:]]*[^[:space:]]+' deploy/ | sort -u

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ cat deploy/app.yaml
image: registry.example/app:v1.2.3
image: registry.example/worker:v1.2.3
::exit-code::0
$ grep -RhoE 'image:[[:space:]]*[^[:space:]]+' deploy/ | sort -u
image: registry.example/app:v1.2.3
image: registry.example/worker:v1.2.3
::exit-code::0

YouTube Short

Which image will deploy?

Grep deployment manifests for image lines to confirm the tag before rollout or rollback.

LinkedIn hook

Find the image tags your deployment files reference without printing env values.

Question: Have you ever deployed the right code with the wrong image tag?

experiments

A/B tests to run

Metric: click_through_rate

A: Which image will deploy?

B: Catch the wrong image tag.