Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalbigaj committed Sep 5, 2022
2 parents 76cd6a9 + 5185382 commit cf0c949
Show file tree
Hide file tree
Showing 82 changed files with 8,591 additions and 272 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ test/pullrequest/pullrequest-init
# Temporary GOPATH used during code gen if user's Tekton checkout is
# not already in GOPATH.
.gopath

# Backup of API reference docs generated by sed
docs/pipeline-api.md.backup
18 changes: 17 additions & 1 deletion cmd/resolvers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ limitations under the License.
package main

import (
"fmt"
"os"
"strings"

"github.com/tektoncd/pipeline/pkg/apis/resolution/v1alpha1"
"github.com/tektoncd/pipeline/pkg/resolution/resolver/bundle"
"github.com/tektoncd/pipeline/pkg/resolution/resolver/framework"
Expand All @@ -30,8 +34,20 @@ import (
func main() {
ctx := filteredinformerfactory.WithSelectors(signals.NewContext(), v1alpha1.ManagedByLabelKey)

apiURL := os.Getenv("HUB_API")
hubURL := hub.DefaultHubURL
if apiURL == "" {
hubURL = hub.DefaultHubURL
} else {
if !strings.HasSuffix(apiURL, "/") {
apiURL += "/"
}
hubURL = apiURL + hub.YamlEndpoint
}
fmt.Println("RUNNING WITH HUB URL PATTERN:", hubURL)

sharedmain.MainWithContext(ctx, "controller",
framework.NewController(ctx, &git.Resolver{}),
framework.NewController(ctx, &hub.Resolver{}),
framework.NewController(ctx, &hub.Resolver{HubURL: hubURL}),
framework.NewController(ctx, &bundle.Resolver{}))
}
12 changes: 12 additions & 0 deletions config/config-feature-flags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ data:
# Setting this flag to "true" enables CloudEvents for Runs, as long as a
# CloudEvents sink is configured in the config-defaults config map
send-cloudevents-for-runs: "false"
# Setting this flag to "true" enables remote resolution of Tekton OCI bundles.
# This is an experimental feature and thus should still be considered
# an alpha feature.
enable-bundles-resolver: "false"
# Setting this flag to "true" enables remote resolution of tasks and pipelines via the Tekton Hub.
# This is an experimental feature and thus should still be considered
# an alpha feature.
enable-hub-resolver: "false"
# Setting this flag to "true" enables remote resolution of tasks and pipelines from Git repositories.
# This is an experimental feature and thus should still be considered
# an alpha feature.
enable-git-resolver: "false"
27 changes: 27 additions & 0 deletions config/resolvers/200-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
# ClusterRole for resolvers to monitor and update resolutionrequests.
name: tekton-pipelines-resolvers-resolution-request-updates
labels:
app.kubernetes.io/component: resolvers
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
rules:
- apiGroups: ["resolution.tekton.dev"]
resources: ["resolutionrequests", "resolutionrequests/status"]
verbs: ["get", "list", "watch", "update", "patch"]
33 changes: 33 additions & 0 deletions config/resolvers/200-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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.

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tekton-pipelines-resolvers-namespace-rbac
namespace: tekton-pipelines
labels:
app.kubernetes.io/component: resolvers
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
rules:
# Needed to watch and load configuration and secret data.
- apiGroups: [""]
resources: ["configmaps", "secrets"]
verbs: ["get", "list", "update", "watch"]

# This is needed by leader election to run the controller in HA.
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
23 changes: 23 additions & 0 deletions config/resolvers/200-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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: ServiceAccount
metadata:
name: tekton-pipelines-resolvers
namespace: tekton-pipelines
labels:
app.kubernetes.io/component: resolvers
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
31 changes: 31 additions & 0 deletions config/resolvers/201-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 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: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tekton-pipelines-resolvers
namespace: tekton-pipelines
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
subjects:
- kind: ServiceAccount
name: tekton-pipelines-resolvers
namespace: tekton-pipelines
roleRef:
kind: ClusterRole
name: tekton-pipelines-resolvers-resolution-request-updates
apiGroup: rbac.authorization.k8s.io
31 changes: 31 additions & 0 deletions config/resolvers/201-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 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: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-pipelines-resolvers-namespace-rbac
namespace: tekton-pipelines
labels:
app.kubernetes.io/component: resolvers
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
subjects:
- kind: ServiceAccount
name: tekton-pipelines-resolvers
namespace: tekton-pipelines
roleRef:
kind: Role
name: tekton-pipelines-resolvers-namespace-rbac
apiGroup: rbac.authorization.k8s.io
28 changes: 28 additions & 0 deletions config/resolvers/bundleresolver-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: bundleresolver-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 service account name to use for bundle requests.
default-service-account: "default"
# The default layer kind in the bundle image.
default-kind: "task"
30 changes: 30 additions & 0 deletions config/resolvers/git-resolver-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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: git-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 maximum amount of time a single git resolution may take.
fetch-timeout: "1m"
# The git url to fetch the remote resource from.
default-url: "https://github.com/tektoncd/catalog.git"
# The git revision to fetch the remote resource from.
default-revision: "main"
28 changes: 28 additions & 0 deletions config/resolvers/hubresolver-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: hubresolver-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 catalog from where to pull the resource.
default-catalog: "Tekton"
# The default layer kind in the hub image.
default-kind: "task"
Loading

0 comments on commit cf0c949

Please sign in to comment.