@@ -43,7 +43,10 @@ import (
43
43
)
44
44
45
45
// Upgrade this when a new version is released
46
- const vaultOperatorVersion = "1.22.4"
46
+ const (
47
+ defaultTimeout = 2 * time .Minute
48
+ vaultOperatorVersion = "1.22.4"
49
+ )
47
50
48
51
var testenv env.Environment
49
52
@@ -132,7 +135,7 @@ func installVaultOperator(ctx context.Context, cfg *envconf.Config) (context.Con
132
135
helm .WithArgs ("--create-namespace" ),
133
136
helm .WithVersion (vaultOperatorVersion ),
134
137
helm .WithWait (),
135
- helm .WithTimeout ("2m" ),
138
+ helm .WithTimeout (defaultTimeout . String () ),
136
139
)
137
140
if err != nil {
138
141
return ctx , fmt .Errorf ("installing vault-operator: %w" , err )
@@ -148,7 +151,7 @@ func uninstallVaultOperator(ctx context.Context, cfg *envconf.Config) (context.C
148
151
helm .WithName ("vault-operator" ),
149
152
helm .WithNamespace ("vault-operator" ),
150
153
helm .WithWait (),
151
- helm .WithTimeout ("2m" ),
154
+ helm .WithTimeout (defaultTimeout . String () ),
152
155
)
153
156
if err != nil {
154
157
return ctx , fmt .Errorf ("uninstalling vault-operator: %w" , err )
@@ -176,7 +179,7 @@ func installVaultSecretsWebhook(ctx context.Context, cfg *envconf.Config) (conte
176
179
helm .WithNamespace ("vault-secrets-webhook" ),
177
180
helm .WithArgs ("-f" , "deploy/vault-secrets-webhook/values.yaml" , "--set" , "image.tag=" + version ),
178
181
helm .WithWait (),
179
- helm .WithTimeout ("2m" ),
182
+ helm .WithTimeout (defaultTimeout . String () ),
180
183
)
181
184
if err != nil {
182
185
return ctx , fmt .Errorf ("installing vault-secrets-webhook: %w" , err )
@@ -192,7 +195,7 @@ func uninstallVaultSecretsWebhook(ctx context.Context, cfg *envconf.Config) (con
192
195
helm .WithName ("vault-secrets-webhook" ),
193
196
helm .WithNamespace ("vault-secrets-webhook" ),
194
197
helm .WithWait (),
195
- helm .WithTimeout ("2m" ),
198
+ helm .WithTimeout (defaultTimeout . String () ),
196
199
)
197
200
if err != nil {
198
201
return ctx , fmt .Errorf ("uninstalling vault-secrets-webhook: %w" , err )
@@ -233,7 +236,7 @@ func installVault(ctx context.Context, cfg *envconf.Config) (context.Context, er
233
236
}
234
237
235
238
// wait for the statefulSet to become available
236
- err = wait .For (conditions .New (r ).ResourcesFound (statefulSets ), wait .WithTimeout (1 * time . Minute ))
239
+ err = wait .For (conditions .New (r ).ResourcesFound (statefulSets ), wait .WithTimeout (defaultTimeout ))
237
240
if err != nil {
238
241
return ctx , err
239
242
}
@@ -245,7 +248,7 @@ func installVault(ctx context.Context, cfg *envconf.Config) (context.Context, er
245
248
}
246
249
247
250
// wait for the pod to become available
248
- err = wait .For (conditions .New (r ).PodReady (& pod ), wait .WithTimeout (1 * time . Minute ))
251
+ err = wait .For (conditions .New (r ).PodReady (& pod ), wait .WithTimeout (defaultTimeout ))
249
252
if err != nil {
250
253
return ctx , err
251
254
}
@@ -263,7 +266,7 @@ func waitForVaultTLS(ctx context.Context, cfg *envconf.Config) (context.Context,
263
266
}
264
267
265
268
// wait for the vault-tls secret to become available
266
- err := wait .For (conditions .New (cfg .Client ().Resources ()).ResourcesFound (vaultTLSSecrets ), wait .WithTimeout (1 * time . Minute ))
269
+ err := wait .For (conditions .New (cfg .Client ().Resources ()).ResourcesFound (vaultTLSSecrets ), wait .WithTimeout (defaultTimeout ))
267
270
if err != nil {
268
271
return ctx , err
269
272
}
0 commit comments