Skip to content

Commit 6b49b63

Browse files
committed
Add ConfigMap which can contain pipelines info
As of now we fetch version of pipelines through labels present on the deployments which is read by tools such as `tkn cli` and display the version. This version may not be displayed to users if they don't have permission to view the deployment. In this commit we are adding 1. A `ConfigMap` which contains version information. 2. RBAC which will give appropriate permissions to view the ConfigMap irrespective of whether user is has permission to view other objects in that namespace or not. Signed-off-by: vinamra28 <[email protected]>
1 parent 55ae856 commit 6b49b63

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

config/200-role.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,21 @@ rules:
8181
- apiGroups: ["coordination.k8s.io"]
8282
resources: ["leases"]
8383
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
84+
---
85+
apiVersion: rbac.authorization.k8s.io/v1
86+
kind: Role
87+
metadata:
88+
name: tekton-pipelines-info
89+
namespace: tekton-pipelines
90+
labels:
91+
app.kubernetes.io/instance: default
92+
app.kubernetes.io/part-of: tekton-pipelines
93+
rules:
94+
# All system:authenticated users needs to have access
95+
# of the pipelines-info ConfigMap even if they don't
96+
# have access to the other resources present in the
97+
# installed namespace.
98+
- apiGroups: [""]
99+
resources: ["configmaps"]
100+
resourceNames: ["pipelines-info"]
101+
verbs: ["get"]

config/201-rolebinding.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,22 @@ roleRef:
8383
kind: Role
8484
name: tekton-pipelines-leader-election
8585
apiGroup: rbac.authorization.k8s.io
86+
---
87+
apiVersion: rbac.authorization.k8s.io/v1
88+
kind: RoleBinding
89+
metadata:
90+
name: tekton-pipelines-info
91+
namespace: tekton-pipelines
92+
labels:
93+
app.kubernetes.io/instance: default
94+
app.kubernetes.io/part-of: tekton-pipelines
95+
subjects:
96+
# Giving all system:authenticated users the access of the
97+
# ConfigMap which contains version information.
98+
- kind: Group
99+
name: system:authenticated
100+
apiGroup: rbac.authorization.k8s.io
101+
roleRef:
102+
apiGroup: rbac.authorization.k8s.io
103+
kind: Role
104+
name: tekton-pipelines-info

config/config-info.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2021 The Tekton Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: v1
16+
kind: ConfigMap
17+
metadata:
18+
name: pipelines-info
19+
namespace: tekton-pipelines
20+
labels:
21+
app.kubernetes.io/instance: default
22+
app.kubernetes.io/part-of: tekton-pipelines
23+
data:
24+
# Contains pipelines version which can be queried by external
25+
# tools such as CLI. Elevated permissions are already given to
26+
# this ConfigMap such that even if we don't have access to
27+
# other resources in the namespace we still can have access to
28+
# this ConfigMap.
29+
version: "devel"

0 commit comments

Comments
 (0)