@@ -85,22 +85,26 @@ generate_ssh_key() {
85
85
setup_ssh_secret_directory () {
86
86
mv " $TMPDIR /secret/ssh-privatekey.pub" " $TMPDIR /secret/ssh-publickey"
87
87
cat << EOF >"$TMPDIR /secret/known_hosts"
88
- github.com ssh-rsa AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
88
+ github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
89
89
EOF
90
90
}
91
91
92
92
create_ssh_secret () {
93
93
kubectl create secret generic ssh-key --namespace pipeline-service-ci \
94
94
--from-file=" $TMPDIR /secret" \
95
- --type kubernetes.io/ssh-auth
95
+ --type kubernetes.io/ssh-auth \
96
+ --dry-run=client \
97
+ -o yaml \
98
+ | kubectl apply -f -
96
99
kubectl annotate secret ssh-key --namespace pipeline-service-ci \
100
+ --overwrite \
97
101
" tekton.dev/git-0=github.com" # Flag the secret to be used to connect to GitHub
98
102
}
99
103
100
104
register_ssh_key () {
101
- echo " Register the public key and enable 'Allow write access': "
102
- echo " URL: https://github.com/openshift-pipelines/pipeline-service/settings/keys "
103
- echo " Public key: $( cat " $TMPDIR /secret/ssh-publickey " ) "
105
+ echo " Register the public key: https://github.com/openshift-pipelines/pipeline-service/settings/keys "
106
+ echo " Key: $( cat " $TMPDIR /secret/ssh-publickey " ) "
107
+ echo " Allow write access: True "
104
108
read -rs -p " Press Enter to continue... "
105
109
}
106
110
@@ -123,7 +127,11 @@ generate_token() {
123
127
}
124
128
125
129
create_token_secret () {
126
- kubectl create secret generic github --namespace pipeline-service-ci --from-file=" $TMPDIR /secret"
130
+ kubectl create secret generic github --namespace pipeline-service-ci \
131
+ --from-file=" $TMPDIR /secret" \
132
+ --dry-run=client \
133
+ -o yaml \
134
+ | kubectl apply -f -
127
135
rm -rf " $TMPDIR /secret"
128
136
}
129
137
0 commit comments