Skip to content

Commit 1edc9ee

Browse files
staged-images: Fix duplicate sources, switch to coreos/chunkah (#159)
Renovate PR #157 updated both fedora-bootc:43 and fedora-bootc:44 to fedora-bootc:45, creating duplicate entries in sources.json. The _field Justfile recipe returned multiple lines, embedding newlines in image references and breaking mirror/build/push steps. Remove the duplicate, harden all jq lookups to error on duplicates, and add unique_by to matrix generation to prevent duplicate GHA jobs. Also extend the Renovate "Disable Fedora OCI updates" rule to cover the custom.regex manager (sources.json), scoped to tag-only updates so digest pinning still works. This prevents Renovate from collapsing distinct Fedora version entries into duplicates again. Switch chunkah image from quay.io/jlebon/chunkah to quay.io/coreos/chunkah. Assisted-by: OpenCode (Claude Opus 4) Signed-off-by: Colin Walters <walters@verbum.org> Signed-off-by: Gursewak Mangat <gursmangat@gmail.com> Co-authored-by: Gursewak Mangat <gursmangat@gmail.com>
1 parent df4f1cb commit 1edc9ee

4 files changed

Lines changed: 17 additions & 19 deletions

File tree

renovate-shared-config.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,23 @@
186186
],
187187
"pinDigests": false
188188
},
189-
// Disable Fedora OCI updates
189+
// Disable Fedora OCI tag updates
190190
//
191-
// This is due to there not being an easy way to tell Renovate which
192-
// Fedora version is "stable" and which has not been released yet.
191+
// Renovate can't distinguish stable vs unreleased Fedora versions,
192+
// so we disable tag bumps. Digest-only updates are still allowed
193+
// via the separate rule below.
193194
{
194-
"description": ["Disable Fedora OCI updates"],
195+
"description": ["Disable Fedora OCI tag updates (can't distinguish stable vs unreleased)"],
195196
"matchManagers": [
196197
"dockerfile",
197-
"github-actions"
198+
"github-actions",
199+
"custom.regex"
198200
],
199201
"matchDepNames": [
200202
"quay.io/fedora/fedora",
201203
"quay.io/fedora/fedora-bootc"
202204
],
205+
"matchUpdateTypes": ["major", "minor", "patch"],
203206
"enabled": false
204207
},
205208
// Ignore bootc cargo dependencies to fix failing Renovate task

staged-images/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Usage: just staged-images/build fedora-bootc-44
99

1010
ARG SOURCE_IMAGE
11-
ARG CHUNKAH=quay.io/jlebon/chunkah:latest
11+
ARG CHUNKAH=quay.io/coreos/chunkah:latest
1212
ARG MAX_LAYERS=128
1313

1414
FROM ${SOURCE_IMAGE} AS source

staged-images/Justfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ _sources := justfile_directory() / "sources.json"
22
registry := env("REGISTRY", "ghcr.io")
33
registry_owner := env("REGISTRY_OWNER", "bootc-dev")
44

5-
# Look up a field from sources.json by image key (e.g. fedora-bootc-43)
5+
# Look up a field from sources.json by image key (e.g. fedora-bootc-43).
6+
# Errors if the key matches zero or more than one entry.
67
[private]
78
_field image field:
8-
@jq -re --arg n "{{image}}" '.[] | select(.name + "-" + .tag == $n) | .{{field}}' "{{_sources}}"
9+
@jq -re --arg n "{{image}}" '[.[] | select(.name + "-" + .tag == $n)] | if length != 1 then error("expected exactly 1 match for \($n), got \(length)") else .[0].{{field}} end' "{{_sources}}"
910

1011
# List available staged images
1112
list:
12-
@jq -r '.[] | .name + "-" + .tag' "{{_sources}}"
13+
@jq -r '[.[] | .name + "-" + .tag] | unique | .[]' "{{_sources}}"
1314

1415
# Mirror an upstream source image to our registry.
1516
# Usage: just staged-images/mirror fedora-bootc-43
@@ -63,7 +64,7 @@ build image:
6364
build-all:
6465
#!/bin/bash
6566
set -euo pipefail
66-
for image in $(jq -r '.[] | .name + "-" + .tag' "{{_sources}}"); do
67+
for image in $(jq -r '[.[] | .name + "-" + .tag] | unique | .[]' "{{_sources}}"); do
6768
just {{justfile_directory()}}/build "$image"
6869
done
6970

@@ -92,10 +93,10 @@ push image arch="":
9293
# Generate GHA matrices from sources.json (used by CI workflow)
9394
[private]
9495
ci-matrix:
95-
@jq -c '[.[] | . as $img | {name: ($img.name + "-staged"), tag: $img.tag, image_key: ($img.name + "-" + $img.tag), arch: "amd64", runner: "ubuntu-24.04"}, {name: ($img.name + "-staged"), tag: $img.tag, image_key: ($img.name + "-" + $img.tag), arch: "arm64", runner: "ubuntu-24.04-arm"}] | {include: .}' "{{_sources}}"
96+
@jq -c '[.[] | . as $img | {name: ($img.name + "-staged"), tag: $img.tag, image_key: ($img.name + "-" + $img.tag), arch: "amd64", runner: "ubuntu-24.04"}, {name: ($img.name + "-staged"), tag: $img.tag, image_key: ($img.name + "-" + $img.tag), arch: "arm64", runner: "ubuntu-24.04-arm"}] | unique_by([.name, .tag, .arch]) | {include: .}' "{{_sources}}"
9697
[private]
9798
ci-mirror-matrix:
98-
@jq -c '[.[] | {name: .name, tag: .tag, source: .source, mirror_name: (.name + "-source")}] | {include: .}' "{{_sources}}"
99+
@jq -c '[.[] | {name: .name, tag: .tag, source: .source, mirror_name: (.name + "-source")}] | unique_by([.name, .tag]) | {include: .}' "{{_sources}}"
99100
[private]
100101
ci-manifest-matrix:
101-
@jq -c '[.[] | {name: (.name + "-staged"), tag: .tag}] | {include: .}' "{{_sources}}"
102+
@jq -c '[.[] | {name: (.name + "-staged"), tag: .tag}] | unique_by([.name, .tag]) | {include: .}' "{{_sources}}"

staged-images/sources.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
[
2-
{
3-
"_renovate": "datasource=docker depName=quay.io/fedora/fedora-bootc",
4-
"name": "fedora-bootc",
5-
"tag": "45",
6-
"source": "quay.io/fedora/fedora-bootc:45@sha256:92faaef45bbfe2d24761a1ddacc277a85916d45365360e638a2b60802b40429b"
7-
},
82
{
93
"_renovate": "datasource=docker depName=quay.io/fedora/fedora-bootc",
104
"name": "fedora-bootc",

0 commit comments

Comments
 (0)