Skip to content

Commit f6216c5

Browse files
committed
chore: centralize ko base image configuration
- Add defaultBaseImage to .ko.yaml for consistent base image usage - Remove inline .ko.yaml generation from CI workflow - Remove inline .ko.yaml generation from presubmit test script - Use repository's .ko.yaml as single source of truth This eliminates duplication and makes base image configuration easier to maintain and update in one place. Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
1 parent ec2f685 commit f6216c5

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,7 @@ jobs:
105105
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
106106
- name: ko-resolve
107107
run: |
108-
cat <<EOF > .ko.yaml
109-
defaultBaseImage: cgr.dev/chainguard/static
110-
baseImageOverrides:
111-
# Use the combined base image for images that should include Windows support.
112-
# NOTE: Make sure this list of images to use the combined base image is in sync with what's in tekton/publish.yaml's 'create-ko-yaml' Task.
113-
github.com/tektoncd/pipeline/cmd/entrypoint: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
114-
github.com/tektoncd/pipeline/cmd/nop: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
115-
github.com/tektoncd/pipeline/cmd/workingdirinit: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
116-
117-
github.com/tektoncd/pipeline/cmd/git-init: cgr.dev/chainguard/git
118-
EOF
119-
108+
# Use the repository's .ko.yaml for consistent base images
120109
KO_DOCKER_REPO=example.com ko resolve -l 'app.kubernetes.io/component!=resolvers' --platform=all --push=false -R -f config 1>/dev/null
121110
KO_DOCKER_REPO=example.com ko resolve --platform=all --push=false -f config/resolvers 1>/dev/null
122111
e2e-tests:

.ko.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
defaultBaseImage: cgr.dev/chainguard/static@sha256:67a1b00e0134e2b3a614c7198a26f7deed9d11b7acad4d52c79c0cfd47a2eae7
12
baseImageOverrides:
3+
# Use the combined base image for images that should include Windows support.
4+
# NOTE: Make sure this list of images to use the combined base image is in sync with what's in tekton/publish.yaml's 'create-ko-yaml' Task.
5+
github.com/tektoncd/pipeline/cmd/entrypoint: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
6+
github.com/tektoncd/pipeline/cmd/nop: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
7+
github.com/tektoncd/pipeline/cmd/workingdirinit: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
8+
9+
github.com/tektoncd/pipeline/cmd/git-init: cgr.dev/chainguard/git
210
github.com/tektoncd/pipeline/cmd/resolvers: ghcr.io/tektoncd/plumbing/tini-git@sha256:2c18f0b3ed4394e27068b5c70bb55419797e8fc743d8ea9e0c2766001b36b5b4

test/presubmit-tests.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,7 @@ function check_yaml_lint() {
4646
function ko_resolve() {
4747
header "Running `ko resolve`"
4848

49-
cat <<EOF > .ko.yaml
50-
defaultBaseImage: cgr.dev/chainguard/static
51-
baseImageOverrides:
52-
# Use the combined base image for images that should include Windows support.
53-
# NOTE: Make sure this list of images to use the combined base image is in sync with what's in tekton/publish.yaml's 'create-ko-yaml' Task.
54-
github.com/tektoncd/pipeline/cmd/entrypoint: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
55-
github.com/tektoncd/pipeline/cmd/nop: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
56-
github.com/tektoncd/pipeline/cmd/workingdirinit: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
57-
58-
github.com/tektoncd/pipeline/cmd/resolvers: ghcr.io/tektoncd/plumbing/tini-git@sha256:2c18f0b3ed4394e27068b5c70bb55419797e8fc743d8ea9e0c2766001b36b5b4
59-
EOF
60-
49+
# Use the repository's .ko.yaml for consistent base images
6150
KO_DOCKER_REPO=example.com ko resolve -l 'app.kubernetes.io/component!=resolvers' --platform=all --push=false -R -f config 1>/dev/null
6251
KO_DOCKER_REPO=example.com ko resolve --platform=all --push=false -f config/resolvers 1>/dev/null
6352
}

0 commit comments

Comments
 (0)