-
Notifications
You must be signed in to change notification settings - Fork 121
[remote-resolution] Proof-of-Concept Controller #806
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit adds a controller, several reconcilers, and a set of helpers that all work in tandem to provide a framework for resolving Tekton resources from places like git repos. For this proof of concept only Tekton's Pipeline type is resolvable but in principle the solutions included here are agnostic to the content being requested. In more concrete terms this project will take a PipelineRun that looks like this: ```yaml kind: PipelineRun metadata: annotations: resolution.tekton.dev/resolver: git git.repo: https://github.com/sbwsg/experimental.git git.commit: 326ad1a git.path: /remote-resolution/pipeline.yaml spec: status: PipelineRunPending ``` and turn it in to one that looks like this: ```yaml kind: PipelineRun metadata: # <same as above> status: # this pipelineSpec has been pulled in from git pipelineSpec: tasks: - name: fetch-from-git taskSpec: metadata: {} spec: null steps: - image: alpine/git name: "" resources: {} script: | git clone https://github.com/tektoncd/results ``` Here's a high level overview of the different parts in play: 1. (Shown in the YAML above) PipelineRuns get a new syntax to indicate the place that a `pipelineSpec` should be fetched from. In this proof of concept that syntax takes the form of some specific labels and annotations. 2. A component interprets the syntax from (1) and converts it into a generic request for a resource. In this proof of concept the "generic request" is either an HTTP call or an instance of a new CRD called a `ResourceRequest`. Both have been implemented to try and figure out which approach better suits the project's needs. 3. A resolver sees the request from (2) and figures out if it can respond. The resolver fetches the resource if so. In this proof of concept three resolvers have been implemented: a "noop" resolver for testing, an "in-cluster" resolver that can fetch pipelines from inside the cluster, and a "git" resolver that can fetch from public git repos. The idea for (3) is to make writing a Resolver easy and to do so in a way that's independent of the request format in (2). A resolver shouldn't care if the request is coming in via HTTP or a CRD or anything else. To that end a go interface has been introduced in the `pkg/reconciler/framework` directory that resolvers can implement to hide all the boilerplate. See remote-resolution/README.md for more details on installing and trying out this controller.
The following users are mentioned in OWNERS file(s) but are not members of the tektoncd org.
|
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/close |
@sbwsg: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Depends on tektoncd#806 for annotation based remote resolution to work
Depends on tektoncd#806 for annotation based remote resolution to work
Depends on tektoncd#806 for annotation based remote resolution to work
toTriggerTemplate() add spec.params to tt.params conversion add toTriggers add el/rbac for workflows add repos/events Add interceptor based on eventType Update example for demo small changes for demo Add gitRef fields Depends on tektoncd#806 for annotation based remote resolution to work Add minimal + example.yaml remove illegal char
toTriggerTemplate() add spec.params to tt.params conversion add toTriggers add el/rbac for workflows add repos/events Add interceptor based on eventType Update example for demo small changes for demo Add gitRef fields Depends on tektoncd#806 for annotation based remote resolution to work Add minimal + example.yaml remove illegal char update triggers version Update autogen
toTriggerTemplate() add spec.params to tt.params conversion add toTriggers add el/rbac for workflows add repos/events Add interceptor based on eventType Update example for demo small changes for demo Add gitRef fields Depends on tektoncd#806 for annotation based remote resolution to work Add minimal + example.yaml remove illegal char update triggers version Update autogen add comments convert package + first unit test
Changes
This commit adds a controller, several reconcilers, and a set of helpers that
all work in tandem to provide a framework for resolving Tekton resources from
places like git repos. For this proof of concept only Tekton's
Pipeline
type isresolvable but in principle the solutions included here are agnostic to the
content being requested.
In more concrete terms this project will take a
PipelineRun
that looks likethis:
and turn it in to one that looks like this:
Here's a high level overview of the different parts in play:
(Shown in the YAML above)
PipelineRuns
get a new syntax to indicate theplace that a
pipelineSpec
should be fetched from. In this proof of conceptthat syntax takes the form of some specific annotations.
A component interprets the syntax from (1) and converts it into a generic
request for a resource. In this proof of concept the "generic request" is
either an HTTP call or an instance of a new CRD called a
ResourceRequest
.Both have been implemented to try and figure out which approach better suits
the project's needs.
A resolver sees the request from (2) and figures out if it can respond. The
resolver fetches the resource if so. In this proof of concept three resolvers
have been implemented: a "noop" resolver for testing, an "in-cluster" resolver
that can fetch pipelines from inside the cluster, and a "git" resolver that can
fetch from public git repos.
The idea for (3) is to make writing a Resolver easy and to do so in a way that's
independent of the request format in (2). A resolver shouldn't care if the request
is coming in via HTTP or a CRD or anything else. To that end a go interface has
been introduced in the
pkg/reconciler/framework
directory that resolvers canimplement to hide all the boilerplate.
See remote-resolution/README.md for more details on installing and trying out
this controller.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them: