@@ -155,7 +155,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
155
155
)
156
156
assert .EqualError (t , err , testutil .Undent (`
157
157
no auth mode specified. You can use one of four auth modes:
158
- - Use --venafi-cloud with --credentials-file or --client-id with --private-key-path to use the Venafi Cloud Key Pair Service Account mode.
158
+ - Use ( --venafi-cloud with --credentials-file) or ( --client-id with --private-key-path) to use the Venafi Cloud Key Pair Service Account mode.
159
159
- Use --venafi-connection for the Venafi Cloud VenafiConnection mode.
160
160
- Use --credentials-file alone if you want to use the Jetstack Secure OAuth mode.
161
161
- Use --api-token if you want to use the Jetstack Secure API Token mode.
@@ -196,6 +196,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
196
196
Server : "http://example.com" ,
197
197
OrganizationID : "example" ,
198
198
EndpointPath : "api/v1/data" ,
199
+ BackoffMaxTime : 10 * time .Minute ,
199
200
}
200
201
require .NoError (t , err )
201
202
assert .Equal (t , expect , got )
@@ -221,7 +222,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
221
222
uploader_id: test-agent
222
223
upload_path: "/testing/path"
223
224
` )),
224
- withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath , "--backoff-max-time" , "5m " ),
225
+ withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath , "--backoff-max-time" , "99m " ),
225
226
)
226
227
expect := CombinedConfig {
227
228
Server : "http://localhost:8080" ,
@@ -234,7 +235,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
234
235
UploadPath : "/testing/path" ,
235
236
AuthMode : VenafiCloudKeypair ,
236
237
ClusterID : "the cluster name" ,
237
- BackoffMaxTime : 5 * time .Minute ,
238
+ BackoffMaxTime : 99 * time .Minute ,
238
239
}
239
240
require .NoError (t , err )
240
241
assert .Equal (t , expect , got )
@@ -337,7 +338,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
337
338
` )),
338
339
withCmdLineFlags ("--credentials-file" , path ))
339
340
require .NoError (t , err )
340
- assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , OrganizationID : "foo" , ClusterID : "bar" , AuthMode : JetstackSecureOAuth }, got )
341
+ assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , OrganizationID : "foo" , ClusterID : "bar" , AuthMode : JetstackSecureOAuth , BackoffMaxTime : 10 * time . Minute }, got )
341
342
assert .IsType (t , & client.OAuthClient {}, cl )
342
343
})
343
344
@@ -411,7 +412,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
411
412
` )),
412
413
withCmdLineFlags ("--client-id" , "5bc7d07c-45da-11ef-a878-523f1e1d7de1" , "--private-key-path" , path ))
413
414
require .NoError (t , err )
414
- assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , AuthMode : VenafiCloudKeypair , ClusterID : "the cluster name" , UploadPath : "/foo/bar" }, got )
415
+ assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , AuthMode : VenafiCloudKeypair , ClusterID : "the cluster name" , UploadPath : "/foo/bar" , BackoffMaxTime : 10 * time . Minute }, got )
415
416
assert .IsType (t , & client.VenafiCloudClient {}, cl )
416
417
})
417
418
@@ -432,7 +433,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
432
433
` )),
433
434
withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath ))
434
435
require .NoError (t , err )
435
- assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , AuthMode : VenafiCloudKeypair , ClusterID : "the cluster name" , UploadPath : "/foo/bar" }, got )
436
+ assert .Equal (t , CombinedConfig {Server : "https://api.venafi.eu" , Period : time .Hour , AuthMode : VenafiCloudKeypair , ClusterID : "the cluster name" , UploadPath : "/foo/bar" , BackoffMaxTime : 10 * time . Minute }, got )
436
437
})
437
438
438
439
t .Run ("venafi-cloud-keypair-auth: venafi-cloud.upload_path field is required" , func (t * testing.T ) {
@@ -503,12 +504,13 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
503
504
withCmdLineFlags ("--install-namespace" , "venafi" , "--venafi-connection" , "venafi-components" ))
504
505
require .NoError (t , err )
505
506
assert .Equal (t , CombinedConfig {
506
- Period : 1 * time .Hour ,
507
- ClusterID : "the cluster name" ,
508
- AuthMode : VenafiCloudVenafiConnection ,
509
- VenConnName : "venafi-components" ,
510
- VenConnNS : "venafi" ,
511
- InstallNS : "venafi" ,
507
+ Period : 1 * time .Hour ,
508
+ ClusterID : "the cluster name" ,
509
+ AuthMode : VenafiCloudVenafiConnection ,
510
+ VenConnName : "venafi-components" ,
511
+ VenConnNS : "venafi" ,
512
+ InstallNS : "venafi" ,
513
+ BackoffMaxTime : 10 * time .Minute ,
512
514
}, got )
513
515
assert .IsType (t , & client.VenConnClient {}, cl )
514
516
})
0 commit comments