update-image
Skill3 starsChanged 6 months agoMITView on GitHub
Updates the container image on an already-deployed app to a new version. Use when the user says "update my app", "deploy a new version", "ship v2", "bump the image to X", or otherwise wants to roll out a new build of something already running on the cluster.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cluster-loginSkill
- create-clusterSkill
- deploy-appSkill
- expose-appSkill
- getting-startedSkill
- otel-operatorSkill
- prepare-appSkill
- statusSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
If it errors, route to cluster-login first.
- Distinctive: line 38
If the user named the app, use it.
- Distinctive: line 60
If they only have a tag, look up the current image to keep the registry/repo:
- Distinctive: line 88
If it succeeds, you're done.
- Very specific: line 106
If a local k8s/<app>/deployment.yaml exists, update the image: line so the file matches what's running.
- Distinctive: line 108
If no local manifest exists, skip this step.
- Very specific: line 132
Don't use kubectl edit / oc edit — opens an editor, fragile.
- Very specific: line 133
Don't re-apply the whole deployment.yaml from disk unless the local file is already updated.
- Very specific: line 134
Don't suggest latest as a tag.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Update Image
Goal
Roll a deployed app to a new image tag. Then update the local manifest so the file matches what's running.
Step 0 — Confirm access
oc whoamiIf it errors, route to cluster-login first.
If oc returns "Unauthorized" mid-flow
The oc token has expired. Don't retry the failing command. Stop where you are, route to the cluster-login skill, then resume from the failed step.
Step 1 — Figure out which app
If the user named the app, use it. Otherwise:
oc get deployments --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.nameFilter out the platform/system namespaces (openshift-*, kube-*, envoy-gateway-system, argocd, default). Ask:
Q: "Which app do you want to update?"
Options: [one per remaining deployment, label as '<app> (in <namespace>)']Step 2 — Get the new image
Q: "What's the new image?"
Options:
- "Just a new tag — keep the same registry/repo" — ask for the tag
- Other (free text — full image reference)If they only have a tag, look up the current image to keep the registry/repo:
oc get deployment <app> -n <namespace> -o jsonpath='{.spec.template.spec.containers[0].image}'Strip the tag, append the new one. Confirm the full image with the user before applying.
Step 3 — Apply the update
oc set image deployment/<app> <app>=<new-image> -n <namespace>oc set image is the simplest path — it patches just the image field. The container name is usually the same as the app name (that's what deploy-app does). If oc set image complains about an unknown container, look it up:
oc get deployment <app> -n <namespace> -o jsonpath='{.spec.template.spec.containers[*].name}'…and re-run with the right container name.
Step 4 — Watch the rollout
oc rollout status deployment/<app> -n <namespace> --timeout=180sIf it succeeds, you're done. If it stalls or errors:
oc get pods -n <namespace>
oc describe pod <new-pod> -n <namespace>
oc logs <new-pod> -n <namespace>Summarize the issue in one sentence — same triage table as deploy-app. If the new image is broken, offer to roll back:
oc rollout undo deployment/<app> -n <namespace>…then look at the logs together to figure out what's wrong with the new image.
Step 5 — Sync the local manifest
If a local k8s/<app>/deployment.yaml exists, update the image: line so the file matches what's running. This keeps the repo honest — next time someone re-applies the file, it won't downgrade the app.
If no local manifest exists, skip this step.
Quick reference
# Update
oc set image deployment/<app> <app>=<new-image> -n <namespace>
# Watch
oc rollout status deployment/<app> -n <namespace>
# Roll back if needed
oc rollout undo deployment/<app> -n <namespace>
# See rollout history
oc rollout history deployment/<app> -n <namespace>Examples
See references/usage-examples.md for typical conversations (simple tag bump, different registry, rolling back a bad release, container-name mismatch, missing local manifest).
What not to do
- Don't use
kubectl edit/oc edit— opens an editor, fragile. - Don't re-apply the whole
deployment.yamlfrom disk unless the local file is already updated. Otherwise you'll roll back any image bumps that happened viaoc set image. - Don't suggest
latestas a tag. Encourage tags that never move — version numbers likev2,v3— so it's always clear which build is running and rollback has something to roll back to.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

