Skip to content

Commit

Permalink
Use ko:// in e2e tests to exercices current code 🙃
Browse files Browse the repository at this point in the history
Right now, some examples are exercicing old version of the code, and
definitely never the changes that would be on the images in a PR.
Using `ko://` instead helps with that (e2e tests are using `ko` to
apply the samples).

This link `.ko.yaml` in test folder to use the proper base image (as
`ko create …` seems to be running from the `test` folder).

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Aug 18, 2020
1 parent ce7591a commit 0e1ea9b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ spec:
description: The precise commit SHA that was fetched by this Task
steps:
- name: clone
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.12.1
image: ko://github.com/tektoncd/pipeline/cmd/git-init
script: |
#!/bin/ash
CHECKOUT_DIR="$(workspaces.output.path)/$(params.subdirectory)"
cleandir() {
Expand Down
7 changes: 5 additions & 2 deletions examples/v1beta1/pipelineruns/pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ spec:
description: The precise commit SHA that was fetched by this Task
steps:
- name: clone
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.11.0
image: ko://github.com/tektoncd/pipeline/cmd/git-init
script: |
#!/bin/ash
CHECKOUT_DIR="$(workspaces.output.path)/$(params.subdirectory)"
cleandir() {
# Delete any existing contents of the repo directory if it exists.
Expand Down Expand Up @@ -167,9 +168,11 @@ spec:
runAsUser: 0
- name: write-digest
workingDir: $(workspaces.source.path)
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/imagedigestexporter:v0.11.1
image: ko://github.com/tektoncd/pipeline/cmd/imagedigestexporter
# output of imagedigestexport [{"name":"image","digest":"sha256:eed29..660"}]
command: ["/ko-app/imagedigestexporter"]
securityContext:
runAsUser: 0
args:
- -images=[{"name":"$(params.IMAGE)","type":"image","url":"$(params.IMAGE)","digest":"","OutputImageDir":"$(workspaces.source.path)/$(params.CONTEXT)/image-digest"}]
- -terminationMessagePath=$(params.CONTEXT)/image-digested
Expand Down
1 change: 1 addition & 0 deletions test/.ko.yaml

0 comments on commit 0e1ea9b

Please sign in to comment.