|
12 | 12 | - name: images |
13 | 13 | description: List of cmd/* paths to be published as images |
14 | 14 | default: "controller webhook entrypoint nop workingdirinit resolvers sidecarlogresults events" |
| 15 | + - name: koExtraArgs |
| 16 | + description: Extra args to be passed to ko |
| 17 | + default: "--preserve-import-paths" |
15 | 18 | - name: versionTag |
16 | 19 | description: The vX.Y.Z version that the artifacts should be tagged with (including `v`) |
17 | 20 | - name: imageRegistry |
|
59 | 62 | value: "$(params.imageRegistryRegions)" |
60 | 63 | - name: OUTPUT_RELEASE_DIR |
61 | 64 | value: "$(workspaces.output.path)/$(params.versionTag)" |
| 65 | + - name: KO_EXTRA_ARGS |
| 66 | + value: "$(params.koExtraArgs)" |
62 | 67 | results: |
63 | 68 | # IMAGES result is picked up by Tekton Chains to sign the release. |
64 | 69 | # See https://github.com/tektoncd/plumbing/blob/main/docs/signing.md for more info. |
@@ -164,15 +169,20 @@ spec: |
164 | 169 | # The real "tagging" will happen with the "create-release" pipeline. |
165 | 170 | git tag $(params.versionTag) |
166 | 171 |
|
167 | | - ko resolve --platform=$(params.platforms) --preserve-import-paths -t $(params.versionTag) -R -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.yaml |
| 172 | + ko resolve \ |
| 173 | + --image-label=org.opencontainers.image.source=https://$(params.package) \ |
| 174 | + --platform=$(params.platforms) \ |
| 175 | + -t $(params.versionTag) \ |
| 176 | + -R ${KO_EXTRA_ARGS} \ |
| 177 | + -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.yaml |
168 | 178 | # Publish images and create release.notags.yaml |
169 | 179 | # This is useful if your container runtime doesn't support the `image-reference:tag@digest` notation |
170 | 180 | # This is currently the case for `cri-o` (and most likely others) |
171 | 181 | ko resolve \ |
172 | 182 | --image-label=org.opencontainers.image.source=https://$(params.package) \ |
173 | 183 | --platform=$(params.platforms) \ |
174 | | - --preserve-import-paths \ |
175 | | - -R -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.notags.yaml |
| 184 | + -R ${KO_EXTRA_ARGS} \ |
| 185 | + -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.notags.yaml |
176 | 186 |
|
177 | 187 | # Rewrite "devel" to params.versionTag |
178 | 188 | sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/release.yaml |
|
0 commit comments