@@ -31,6 +31,13 @@ async function build(context, version) {
31
31
* Prepare
32
32
*/
33
33
werft . phase ( "prepare" ) ;
34
+
35
+ const werftImg = shell . exec ( "cat .werft/build.yaml | grep dev-environment" ) . trim ( ) . split ( ": " ) [ 1 ] ;
36
+ const devImg = shell . exec ( "yq r .gitpod.yml image" ) . trim ( ) ;
37
+ if ( werftImg !== devImg ) {
38
+ werft . fail ( 'prep' , `Werft job image (${ werftImg } ) and Gitpod dev image (${ devImg } ) do not match` ) ;
39
+ }
40
+
34
41
let buildConfig = context . Annotations || { } ;
35
42
try {
36
43
exec ( `gcloud auth activate-service-account --key-file "${ GCLOUD_SERVICE_ACCOUNT_PATH } "` ) ;
@@ -145,7 +152,7 @@ async function deployToDev(version, previewWithHttps, workspaceFeatureFlags, dyn
145
152
146
153
werft . log ( "secret" , "copy secret into namespace" )
147
154
try {
148
- const auth = exec ( `echo -n "_json_key:$(kubectl get secret gcp-sa-registry-auth --namespace=keys --export - o yaml \
155
+ const auth = exec ( `echo -n "_json_key:$(kubectl get secret gcp-sa-registry-auth --namespace=keys -o yaml \
149
156
| yq r - data['.dockerconfigjson'] \
150
157
| base64 -d)" | base64 -w 0` , { silent : true } ) . stdout . trim ( ) ;
151
158
fs . writeFileSync ( "chart/gcp-sa-registry-auth" ,
@@ -163,7 +170,7 @@ async function deployToDev(version, previewWithHttps, workspaceFeatureFlags, dyn
163
170
164
171
werft . log ( "authProviders" , "copy authProviders" )
165
172
try {
166
- exec ( `kubectl get secret preview-envs-authproviders --namespace=keys --export - o yaml \
173
+ exec ( `kubectl get secret preview-envs-authproviders --namespace=keys -o yaml \
167
174
| yq r - data.authProviders \
168
175
| base64 -d -w 0 \
169
176
> authProviders` , { silent : true } ) . stdout . trim ( ) ;
@@ -303,7 +310,11 @@ async function issueAndInstallCertficate(namespace, domain) {
303
310
304
311
werft . log ( 'certificate' , `copying certificate from "certs/${ namespace } " to "${ namespace } /proxy-config-certificates"` ) ;
305
312
// certmanager is configured to create a secret in the namespace "certs" with the name "${namespace}".
306
- exec ( `kubectl get secret ${ namespace } --namespace=certs --export -o yaml \
313
+ exec ( `kubectl get secret ${ namespace } --namespace=certs -o yaml \
314
+ | yq d - 'metadata.namespace' \
315
+ | yq d - 'metadata.uid' \
316
+ | yq d - 'metadata.resourceVersion' \
317
+ | yq d - 'metadata.creationTimestamp' \
307
318
| sed 's/${ namespace } /proxy-config-certificates/g' \
308
319
| kubectl apply --namespace=${ namespace } -f -` ) ;
309
320
}
0 commit comments