Skip to content

CICD-293 · GitOps environment promotion ​

Encyclopedia · Advanced GitOps and progressive delivery · All snippets

Previous · CICD-292 · Next · CICD-294

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites trusted configuration repository, test cluster and named GitOps controller or rollout controller.
  • Platforms kubernetes, local-lab.
  • Parameters IMAGE_DIGEST.

2. Copy the snippet ​

bash
[[ "${IMAGE_DIGEST:?}" =~ ^sha256:[0-9a-f]{64}$ ]]
IMAGE_DIGEST="$IMAGE_DIGEST" yq -i '.images[0].digest = strenv(IMAGE_DIGEST)' environments/staging/web/kustomization.yaml
kubectl kustomize environments/staging/web | grep -F "@$IMAGE_DIGEST"

3. How it works ​

The overlay commit changes only the image digest. Rendering the overlay verifies that the declared immutable image will reach the target workload.

4. Verify the result ​

Promote in a reviewed PR and preserve the image already verified by CI. Confirm the intended image entry is index zero.

Validation syntax-validated (Bash parse). Status definitions.