Skip to content

Commit

Permalink
Adds a configMap named hub-info to have the Hub version
Browse files Browse the repository at this point in the history
Signed-off-by: Puneet Punamiya [email protected]
  • Loading branch information
PuneetPunamiya committed Jan 2, 2024
1 parent 8aaa311 commit 4f84180
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
23 changes: 23 additions & 0 deletions config/07-hub-info/hub-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 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: hub-info
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-hub
data:
version: devel
50 changes: 50 additions & 0 deletions config/07-hub-info/role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2023 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: Role
metadata:
name: tekton-hub-info
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-hub
rules:
# All system:authenticated users need to have access
# to the hub-info ConfigMap even if they don't
# have access to other resources present in the
# installed namespace
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["hub-info"]
verbs: ["get"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-hub-info
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-hub
subjects:
# Giving all system:authenticated users the access to the
# ConfigMap which contains version information
- kind: Group
name: system:authenticated
apiGroup: rbac.authorization.k8s.io
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: tekton-hub-info
15 changes: 14 additions & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ ui-openshift(){
echo "------------------------------------------"
}

hub-info(){
info Creating Hub-Info Release Yaml

ko resolve -f config/07-hub-info > ${RELEASE_DIR}/hub-info.yaml || {
err 'hub-info release build failed'
return 1
}
echo "------------------------------------------"
}

replaceImageName() {
info Changing Image Name

Expand All @@ -148,6 +158,8 @@ replaceImageName() {
sed -i "s@image: quay.io/tekton-hub/ui@image: ${REGISTRY_BASE_URL}/ui:$RELEASE_VERSION@g" ${RELEASE_DIR}/ui-kubernetes.yaml

sed -i "s@image: quay.io/tekton-hub/ui@image: ${REGISTRY_BASE_URL}/ui:$RELEASE_VERSION@g" ${RELEASE_DIR}/ui-openshift.yaml

sed -i 's/version: .*/version: '"${RELEASE_VERSION}"'/' ${RELEASE_DIR}/hub-info.yaml
}

createNewPreRelease() {
Expand All @@ -157,7 +169,7 @@ createNewPreRelease() {

gh release create --draft --prerelease -t ${RELEASE_VERSION} ${RELEASE_VERSION}

gh release upload ${RELEASE_VERSION} db.yaml db-migration.yaml api-kubernetes.yaml api-openshift.yaml ui-kubernetes.yaml ui-openshift.yaml
gh release upload ${RELEASE_VERSION} db.yaml db-migration.yaml api-kubernetes.yaml api-openshift.yaml ui-kubernetes.yaml ui-openshift.yaml hub-info.yaml
}

createNewBranchAndPush() {
Expand Down Expand Up @@ -194,6 +206,7 @@ main() {
api-openshift
ui-k8s
ui-openshift
hub-info

# Change the image name with the release version specified
echo "********************************************"
Expand Down

0 comments on commit 4f84180

Please sign in to comment.