forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relates to tektoncd#4476 and https://github.com/tektoncd/community/blob/main/teps/0096-pipelines-v1-api.md This resolver replaces `ClusterTask`s going forward. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
- Loading branch information
Showing
18 changed files
with
838 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2022 The Tekton Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cluster-resolver-config | ||
namespace: tekton-pipelines | ||
labels: | ||
app.kubernetes.io/component: resolvers | ||
app.kubernetes.io/instance: default | ||
app.kubernetes.io/part-of: tekton-pipelines | ||
data: | ||
# The default kind to fetch. | ||
default-kind: "task" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Cluster Resolver | ||
|
||
## Resolver Type | ||
|
||
This Resolver responds to type `cluster`. | ||
|
||
## Parameters | ||
|
||
| Param Name | Description | Example Value | | ||
|-------------|-------------------------------------------------------|------------------------------| | ||
| `kind` | The kind of resource to fetch. | `task`, `pipeline` | | ||
| `name` | The name of the resource to fetch. | `some-pipeline`, `some-task` | | ||
| `namespace` | The namespace in the cluster containing the resource. | `default`, `other-namespace` | | ||
|
||
## Requirements | ||
|
||
- A cluster running Tekton Pipeline v0.40.0 or later, with the `alpha` feature gate enabled. | ||
- The [built-in remote resolvers installed](./install.md#installing-and-configuring-remote-task-and-pipeline-resolution). | ||
- The `enable-cluster-resolver` feature flag set to `true`. | ||
|
||
## Configuration | ||
|
||
This resolver uses a `ConfigMap` for its settings. See | ||
[`../config/resolvers/cluster-resolver-config.yaml`](../config/resolvers/cluster-resolver-config.yaml) | ||
for the name, namespace and defaults that the resolver ships with. | ||
|
||
### Options | ||
|
||
| Option Name | Description | Example Values | | ||
|----------------|--------------------------------------------------------------------|--------------------| | ||
| `default-kind` | The default resource kind to fetch if not specified in parameters. | `task`, `pipeline` | | ||
|
||
## Usage | ||
|
||
### Task Resolution | ||
|
||
```yaml | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: remote-task-reference | ||
spec: | ||
taskRef: | ||
resolver: cluster | ||
params: | ||
- name: kind | ||
value: task | ||
- name: name | ||
value: some-task | ||
- name: namespace | ||
value: namespace-containing-task | ||
``` | ||
### Pipeline resolution | ||
```yaml | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
name: remote-pipeline-reference | ||
spec: | ||
pipelineRef: | ||
resolver: cluster | ||
params: | ||
- name: kind | ||
value: pipeline | ||
- name: name | ||
value: some-pipeline | ||
- name: namespace | ||
value: namespace-containing-pipeline | ||
``` | ||
--- | ||
Except as otherwise noted, the content of this page is licensed under the | ||
[Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), | ||
and code samples are licensed under the | ||
[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright 2022 The Tekton Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package cluster | ||
|
||
const ( | ||
// ResourceNameAnnotation is the annotation key for the fetched resource name | ||
ResourceNameAnnotation = "name" | ||
// ResourceNamespaceAnnotation is the annotation key for the fetched resource's namespace | ||
ResourceNamespaceAnnotation = "namespace" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright 2022 The Tekton Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package cluster | ||
|
||
const ( | ||
// DefaultKindKey is the key in the config map for the default kind setting | ||
DefaultKindKey = "default-kind" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright 2022 The Tekton Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package cluster | ||
|
||
const ( | ||
// KindParam is the parameter for the object kind | ||
KindParam = "kind" | ||
// NameParam is the parameter for the object name | ||
NameParam = "name" | ||
// NamespaceParam is the parameter for the namespace containing the object | ||
NamespaceParam = "namespace" | ||
) |
Oops, something went wrong.