Skip to content

Commit 46c1a3f

Browse files
gabemonteroRoming22
authored andcommitted
adjust chains installation now that openshift-pipelines operator is installing chaings
1 parent ba5f2c9 commit 46c1a3f

File tree

10 files changed

+19
-90
lines changed

10 files changed

+19
-90
lines changed

developer/openshift/reset.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,6 @@ uninstall_operators_and_controllers(){
244244
kubectl delete ns "$pac_ns"
245245
fi
246246

247-
printf "\n Uninstalling tekton-chains:\n"
248-
kubectl delete -k "$GITOPS_DIR/tekton-chains" --ignore-not-found=true
249-
tkn_chains_ns=$(kubectl get ns | grep -ie "tekton-chains" | cut -d " " -f 1)
250-
if [[ -n "$pac_ns" ]]; then
251-
kubectl delete ns "$tkn_chains_ns"
252-
fi
253-
254247
printf "\n Uninstalling tekton-results:\n"
255248
kubectl delete -k "$GITOPS_DIR/tekton-results/base" --ignore-not-found=true
256249
tkn_results_ns=$(kubectl get ns | grep -ie "tekton-results" | cut -d " " -f 1)
@@ -266,7 +259,7 @@ uninstall_operators_and_controllers(){
266259
fi
267260

268261
# Checks if the Tekton controllers are uninstalled successfully
269-
mapfile -t controllers < <(kubectl get ns | grep -iE "tekton-results|tekton-chains|pipelines-as-code" | cut -d " " -f 1)
262+
mapfile -t controllers < <(kubectl get ns | grep -iE "tekton-results" | cut -d " " -f 1)
270263
if (( ${#controllers[@]} >= 1 )); then
271264
printf "\n[ERROR] Couldn't remove Tekton controllers, please try removing them manually." >&2
272265
exit 1

operator/gitops/argocd/pipeline-service/tekton-chains/chains-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
kind: ConfigMap
44
metadata:
55
name: chains-config
6-
namespace: tekton-chains
6+
namespace: openshift-pipelines
77

88
data:
99
# See https://tekton.dev/docs/chains/config/

operator/gitops/argocd/pipeline-service/tekton-chains/chains-controller-deployment.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

operator/gitops/argocd/pipeline-service/tekton-chains/chains-secrets-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ apiVersion: v1
33
kind: ServiceAccount
44
metadata:
55
name: chains-secrets-admin
6-
namespace: tekton-chains
6+
namespace: openshift-pipelines
77
---
88
apiVersion: rbac.authorization.k8s.io/v1
99
kind: Role
1010
metadata:
1111
name: chains-secret-admin
12-
namespace: tekton-chains
12+
namespace: openshift-pipelines
1313
rules:
1414
- apiGroups:
1515
- ""
@@ -39,15 +39,15 @@ apiVersion: rbac.authorization.k8s.io/v1
3939
kind: RoleBinding
4040
metadata:
4141
name: chains-secret-admin
42-
namespace: tekton-chains
42+
namespace: openshift-pipelines
4343
roleRef:
4444
apiGroup: rbac.authorization.k8s.io
4545
kind: Role
4646
name: chains-secret-admin
4747
subjects:
4848
- kind: ServiceAccount
4949
name: chains-secrets-admin
50-
namespace: tekton-chains
50+
namespace: openshift-pipelines
5151
---
5252
apiVersion: rbac.authorization.k8s.io/v1
5353
kind: RoleBinding
@@ -61,13 +61,13 @@ roleRef:
6161
subjects:
6262
- kind: ServiceAccount
6363
name: chains-secrets-admin
64-
namespace: tekton-chains
64+
namespace: openshift-pipelines
6565
---
6666
apiVersion: batch/v1
6767
kind: Job
6868
metadata:
6969
name: tekton-chains-signing-secret
70-
namespace: tekton-chains
70+
namespace: openshift-pipelines
7171
annotations:
7272
argocd.argoproj.io/sync-wave: "1"
7373
spec:

operator/gitops/argocd/pipeline-service/tekton-chains/kustomization.yaml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,21 @@ resources:
99
# To list available releases:
1010
# curl -s https://storage.googleapis.com/tekton-releases/ | xq | grep -E 'chains/.*/release.yaml'
1111
#
12-
- https://storage.googleapis.com/tekton-releases/chains/previous/v0.14.0/release.yaml
1312
- chains-secrets-config.yaml
1413
- public-key.yaml
1514

16-
images:
17-
- name: gcr.io/tekton-releases/github.com/tektoncd/chains/cmd/controller:v0.14.0
18-
newName: registry.redhat.io/openshift-pipelines/pipelines-chains-controller-rhel8
19-
newTag: v1.11.0-22
20-
2115
patches:
22-
# allow openshift-gitops to manage tekton-chains
23-
- target:
24-
kind: Namespace
25-
name: tekton-chains
26-
patch: |-
27-
- op: add
28-
path: "/metadata/labels"
29-
value:
30-
argocd.argoproj.io/managed-by: openshift-gitops
31-
# Add some chains configuration
16+
# Add some chains configuration
3217
- path: chains-config.yaml
3318
#
34-
# Mount the chains cert volume and apply operator security standards
35-
- path: chains-controller-deployment.yaml
3619
- target:
3720
kind: Secret
3821
name: signing-secrets
39-
namespace: tekton-chains
22+
namespace: openshift-pipelines
4023
patch: |-
4124
apiVersion: v1
4225
kind: Secret
4326
metadata:
4427
name: signing-secrets
45-
namespace: tekton-chains
28+
namespace: openshift-pipelines
4629
$patch: delete

operator/gitops/argocd/pipeline-service/tekton-chains/public-key.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apiVersion: rbac.authorization.k8s.io/v1
1919
kind: RoleBinding
2020
metadata:
2121
name: tekton-chains-public-key-viewer
22-
namespace: tekton-chains
22+
namespace: openshift-pipelines
2323
roleRef:
2424
apiGroup: rbac.authorization.k8s.io
2525
kind: ClusterRole

operator/images/access-setup/content/bin/setup_work_dir.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ tekton_chains_manifest(){
157157
--workdir /workspace \
158158
--entrypoint /usr/bin/cosign \
159159
"$cosign_image" generate-key-pair
160-
kubectl create namespace tekton-chains --dry-run=client -o yaml > "$chains_namespace"
161-
kubectl create secret generic -n tekton-chains signing-secrets --from-file="$chains_tmp_dir" --dry-run=client -o yaml | \
160+
kubectl create namespace openshift-pipelines --dry-run=client -o yaml > "$chains_namespace"
161+
kubectl create secret generic -n openshift-pipelines signing-secrets --from-file="$chains_tmp_dir" --dry-run=client -o yaml | \
162162
yq '. += {"immutable" :true}' | \
163163
yq "sort_keys(.)" > "$chains_secret"
164164
yq e -n '.resources += ["namespace.yaml", "signing-secrets.yaml"]' > "$chains_kustomize"

operator/images/cluster-setup/content/bin/install.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,12 @@ install_clusters() {
135135

136136
#checking if the pipelines and triggers pods are up and running
137137
printf -- "- Checking deployment status\n"
138-
tektonDeployments=("tekton-pipelines-controller" "tekton-triggers-controller" "tekton-triggers-core-interceptors")
138+
tektonDeployments=("tekton-pipelines-controller" "tekton-triggers-controller" "tekton-triggers-core-interceptors" "tekton-chains-controller")
139139
check_deployments "openshift-pipelines" "${tektonDeployments[@]}" | indent 4
140140
resultsDeployments=("tekton-results-api" "tekton-results-watcher")
141141
check_deployments "tekton-results" "${resultsDeployments[@]}" | indent 4
142142
resultsStatefulsets=("postgres-postgresql" "storage-pool-0")
143143
check_statefulsets "tekton-results" "${resultsStatefulsets[@]}" | indent 4
144-
chainsDeployments=("tekton-chains-controller")
145-
check_deployments "tekton-chains" "${chainsDeployments[@]}" | indent 4
146144

147145
printf -- "- Checking pods status for controlplane namespaces\n"
148146
# list of control plane namespaces
@@ -156,9 +154,9 @@ install_clusters() {
156154
install_shared_manifests() {
157155
CREDENTIALS_DIR="$WORKSPACE_DIR/credentials"
158156

159-
if [ "$(kubectl get secret -n tekton-chains signing-secrets --ignore-not-found -o json | jq -r ".immutable")" != "true" ]; then
160-
kubectl apply -k "$CREDENTIALS_DIR/manifests/compute/tekton-chains"
161-
fi
157+
# if [ "$(kubectl get secret -n openshift-pipelines signing-secrets --ignore-not-found -o json | jq -r ".immutable")" != "true" ]; then
158+
# kubectl apply -k "$CREDENTIALS_DIR/manifests/compute/tekton-chains"
159+
# fi
162160
kubectl apply -k "$CREDENTIALS_DIR/manifests/compute/tekton-results"
163161
}
164162

operator/test/manifests/test/tekton-chains/public-key.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ spec:
1818
set -o nounset
1919
set -o pipefail
2020
set -x
21-
PUBLIC_KEY=$(oc get secret public-key -n tekton-chains -o jsonpath='{.data.cosign\.pub}')
21+
PUBLIC_KEY=$(oc get secret public-key -n openshift-pipelines -o jsonpath='{.data.cosign\.pub}')
2222
echo "$PUBLIC_KEY" | base64 -d
2323
serviceAccountName: chains-test

operator/test/test.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ test_security() {
247247
check_pod_security "tekton-results"
248248
echo " - Check Pod Host Network tekton-results: "
249249
check_host_network "tekton-results"
250-
echo " - Check Pod Security tekton-chains: "
251-
check_pod_security "tekton-chains"
252-
echo " - Check Pod Host Network tekton-chains: "
253-
check_host_network "tekton-chains"
254250

255251
if [[ "$securityErrorFound" == "yes" ]]; then
256252
echo " - Check security failed"

0 commit comments

Comments
 (0)