Skip to content

feat(gitops): allow a different image path in the GitOps commit - #164

Draft
lucaghersi wants to merge 1 commit into
mainfrom
gitops-image-override
Draft

lucaghersi wants to merge 1 commit into
mainfrom
gitops-image-override

Conversation

@lucaghersi

Copy link
Copy Markdown

Type of Change

  • Enhancement / new feature

Description

Goal: let the image path written to the GitOps repository differ from the one pushed to.

Some registries separate publishing from consumption. Google Artifact Registry is one: a push is accepted only into a standard repository, while deployments should reference the virtual repository in front of it, so the upstream behind it can change without editing every manifest. Today both come from docker-image, so a deployment ends up pinned to the publish repository.

          docker-image: my-project/images-publish/my-service        # built, pushed, retagged
          gitops-docker-image: my-project/images/my-service         # written to the manifest

Merging this changes nothing for anyone. gitops-docker-image defaults to docker-image, so every existing caller produces the same GitOps commit, byte for byte. Nothing else reads the new input.

How to review

Two lines of behaviour:

  • action.yml — the new input, and one expression on the GitOps step: ${{ inputs.gitops-docker-image || inputs.docker-image }}. Empty is falsy in a GitHub expression, so an unset input falls through to the old value.
  • Scope is deliberately the GitOps commit only. Build, push and release retag keep using docker-image, because they act on the repository that actually stores the image.

No script changes. update-gitops.sh already takes its image from the environment, so the choice is made where the step is wired. The existing suite covers it unchanged: 109 tests pass, mise run lint clean.

Checklist

  • Make sure all tests pass
  • Update documentation
  • Write tests — no new behaviour in the scripts to test; the change is an input default
  • Reference relevant issue(s)

🤖 Generated with Claude Code

Some registries separate where an image is pushed from where it is
pulled. Google Artifact Registry is one: a push is accepted only into a
standard repository, while a deployment should reference the virtual
repository in front of it, so the upstream behind it can change without
editing every manifest.

gitops-docker-image writes that path to the GitOps repository. It
defaults to docker-image, so an unset input leaves the commit byte for
byte what it was.

Only the GitOps commit is affected. The build, the push and the release
retag keep using docker-image, because they act on the repository that
stores the image.

The scripts are untouched: update-gitops.sh already takes its image from
the environment, so the choice is made where the step is wired.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant