@@ -18,40 +18,12 @@ export class InstallCertificateParams {
18
18
19
19
export async function certReady ( werft : Werft , config : JobConfig , slice : string ) : Promise < boolean > {
20
20
const certName = `harvester-${ config . previewEnvironment . destname } ` ;
21
- const cpu = config . withLargeVM ? 12 : 6 ;
22
- const memory = config . withLargeVM ? 24 : 12 ;
23
-
24
- // set some common vars for TF
25
- // We pass the GCP credentials explicitly, otherwise for some reason TF doesn't pick them up
26
- const commonVars = `GOOGLE_BACKEND_CREDENTIALS=${ GCLOUD_SERVICE_ACCOUNT_PATH } \
27
- GOOGLE_APPLICATION_CREDENTIALS=${ GCLOUD_SERVICE_ACCOUNT_PATH } \
28
- TF_VAR_cert_issuer=${ config . certIssuer } \
29
- TF_VAR_kubeconfig_path=${ GLOBAL_KUBECONFIG_PATH } \
30
- TF_VAR_preview_name=${ config . previewEnvironment . destname } \
31
- TF_VAR_vm_cpu=${ cpu } \
32
- TF_VAR_vm_memory=${ memory } Gi \
33
- TF_VAR_vm_storage_class="longhorn-gitpod-k3s-202209251218-onereplica"`
34
-
35
21
if ( isCertReady ( certName ) ) {
36
22
werft . log ( slice , `Certificate ready` ) ;
37
23
return true
38
24
}
39
25
40
- const maxAttempts = 5
41
- var certReady = false
42
- for ( var i = 1 ; i <= maxAttempts ; i ++ ) {
43
- werft . log ( slice , `Checking for cert readiness: Attempt ${ i } ` ) ;
44
- if ( waitCertReady ( certName ) ) {
45
- certReady = true ;
46
- break ;
47
- }
48
-
49
- werft . log ( slice , `Creating cert: Attempt ${ i } ` ) ;
50
- await execStream ( `${ commonVars } \
51
- TF_CLI_ARGS_plan="-replace=kubernetes_manifest.cert" \
52
- ./dev/preview/workflow/preview/deploy-harvester.sh` ,
53
- { slice : slice } )
54
- }
26
+ const certReady = waitCertReady ( certName )
55
27
56
28
if ( ! certReady ) {
57
29
retrieveFailedCertDebug ( certName , slice )
@@ -62,7 +34,7 @@ export async function certReady(werft: Werft, config: JobConfig, slice: string):
62
34
}
63
35
64
36
function waitCertReady ( certName : string ) : boolean {
65
- const timeout = "240s "
37
+ const timeout = "500s "
66
38
const rc = exec (
67
39
`kubectl --kubeconfig ${ CORE_DEV_KUBECONFIG_PATH } wait --for=condition=Ready --timeout=${ timeout } -n certs certificate ${ certName } ` ,
68
40
{ dontCheckRc : true } ,
0 commit comments