This directory contains a working Resolver based on the instructions from the developer howto in the docs.
This Resolver responds to type demo
.
Name | Desccription | Example Value |
---|---|---|
url |
The repository url. | https://example.com/repo/ |
You can use this as a template to quickly get a new Resolver up and running with your own preferred storage backend.
To reuse the template, simply copy this entire subdirectory to a new
directory. The entire program is defined in
./cmd/demoresolver/main.go
and provides stub
implementations of all the methods defined by the framework.Resolver
interface.
Once copied you'll need to run go mod init
and go mod tidy
at the root
of your project. We don't need this in tektoncd/resolution
because this
submodule relies on the go.mod
and go.sum
defined at the root of the repo.
After your go module is initialized and dependencies tidied, update
config/demo-resolver-deployment.yaml
. The image
field of the container
will need to point to your new go module's name, with a ko://
prefix.
- A computer with
kubectl
andko
installed. - The
tekton-pipelines
namespace andResolutionRequest
controller installed. See the getting started guide for instructions.
- Install the
"demo"
Resolver:
$ ko apply -f ./config/demo-resolver-deployment.yaml
Try creating a ResolutionRequest
targeting "demo"
with no parameters:
$ cat <<EOF > rrtest.yaml
apiVersion: resolution.tekton.dev/v1beta1
kind: ResolutionRequest
metadata:
name: test-resolver-template
labels:
resolution.tekton.dev/type: demo
EOF
$ kubectl apply -f ./rrtest.yaml
$ kubectl get resolutionrequest -w test-resolver-template
You should shortly see the ResolutionRequest
succeed and the content of
a hello-world Pipeline
base64-encoded in the object's status.data
field.
Here's an example PipelineRun that uses the hard-coded demo Pipeline:
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: resolver-demo
spec:
pipelineRef:
resolver: demo
- Just one hard-coded
Pipeline
for demonstration purposes.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.