Skip to content

Commit d859602

Browse files
Change the release builder to build ko. (#991)
Despite using an upgraded go image in certain steps, the ko image that Kf was using to build still had an outdated version of go (1.17) meaning that there was an inconsistency between local development and what was being produced. This change pivots us to use the latest version of ko on the current go base image the pipeline uses ensuring Kf will always be built with an expected version of Go, allowing us to stay up to date on features and patches.
1 parent 329405c commit d859602

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

cmd/generate-release/cloudbuild.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ substitutions:
3030
_EXTRA_TAG: '' # Defaults to _VERSION
3131
_RELEASE_BUCKET: '' # Required
3232
_RELEASE_FOLDER: '' # Defaults to _VERSION
33-
_KO_IMAGE: 'gcr.io/kf-releases/ko:latest'
3433
_CLOUDSDK_IMAGE: 'gcr.io/google.com/cloudsdktool/cloud-sdk:alpine'
3534
_GOLANG_IMAGE: 'golang:1.20'
3635
_BUILDPACK_WRAPPER_GOLANG_IMAGE: 'golang:1.15'
36+
_KO_VERSION: 'github.com/google/ko@latest'
3737

3838
timeout: '1800s'
3939

@@ -43,7 +43,7 @@ options:
4343
steps:
4444
- id: check substitutions
4545
entrypoint: bash
46-
name: "${_KO_IMAGE}"
46+
name: "${_GOLANG_IMAGE}"
4747
args:
4848
- '-euc'
4949
- |
@@ -156,7 +156,7 @@ steps:
156156
done
157157
158158
- id: generate v2 lifecycle image artifacts
159-
name: "${_KO_IMAGE}"
159+
name: "${_GOLANG_IMAGE}"
160160
dir: /workspace
161161
waitFor: ['push third party image']
162162
env:
@@ -184,7 +184,7 @@ steps:
184184
vendor/code.cloudfoundry.org/buildpackapplifecycle/installer/kodata
185185
186186
- id: generate Kf Release
187-
name: "${_KO_IMAGE}"
187+
name: "${_GOLANG_IMAGE}"
188188
dir: /workspace
189189
waitFor: ['push third party image']
190190
env:
@@ -206,7 +206,10 @@ steps:
206206
# Test the main directories to force go mod to update everything.
207207
# go test ./cmd/...
208208
sed -i "s|PROJECT_PLACEHOLDER|${PROJECT_ID}|g" config/config-defaults.yaml
209-
/builder/ko.bash resolve --filename config | sed "s/VERSION_PLACEHOLDER/$${VERSION}/" > /workspace/bin/kf.yaml
209+
210+
go install "${_KO_VERSION}"
211+
212+
ko resolve --filename config | sed "s/VERSION_PLACEHOLDER/$${VERSION}/" > /workspace/bin/kf.yaml
210213
211214
# Append empty config-secrets to kf release.
212215
# The Operator need this to exist so the configmap transformers can do their work.
@@ -223,7 +226,7 @@ steps:
223226
EOF
224227
225228
- id: generate kf Operator Release
226-
name: "${_KO_IMAGE}"
229+
name: "${_GOLANG_IMAGE}"
227230
dir: /workspace/operator
228231
waitFor: ['generate Kf Release']
229232
env:
@@ -267,7 +270,9 @@ steps:
267270
mkdir "${target_dir}"
268271
cp /workspace/bin/kf.yaml "${target_dir}"
269272
270-
/builder/ko.bash resolve --filename config > /workspace/bin/operator.yaml
273+
go install "${_KO_VERSION}"
274+
275+
ko resolve --filename config > /workspace/bin/operator.yaml
271276
272277
cp /workspace/cmd/generate-release/scripts/kfsystems-cr.yaml /workspace/bin/kfsystem.yaml
273278

0 commit comments

Comments
 (0)