@@ -155,7 +155,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
155155 )
156156 assert .EqualError (t , err , testutil .Undent (`
157157 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.
159159 - Use --venafi-connection for the Venafi Cloud VenafiConnection mode.
160160 - Use --credentials-file alone if you want to use the Jetstack Secure OAuth mode.
161161 - Use --api-token if you want to use the Jetstack Secure API Token mode.
@@ -196,6 +196,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
196196 Server : "http://example.com" ,
197197 OrganizationID : "example" ,
198198 EndpointPath : "api/v1/data" ,
199+ BackoffMaxTime : 10 * time .Minute ,
199200 }
200201 require .NoError (t , err )
201202 assert .Equal (t , expect , got )
@@ -221,7 +222,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
221222 uploader_id: test-agent
222223 upload_path: "/testing/path"
223224 ` )),
224- withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath , "--backoff-max-time" , "5m " ),
225+ withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath , "--backoff-max-time" , "99m " ),
225226 )
226227 expect := CombinedConfig {
227228 Server : "http://localhost:8080" ,
@@ -234,7 +235,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
234235 UploadPath : "/testing/path" ,
235236 AuthMode : VenafiCloudKeypair ,
236237 ClusterID : "the cluster name" ,
237- BackoffMaxTime : 5 * time .Minute ,
238+ BackoffMaxTime : 99 * time .Minute ,
238239 }
239240 require .NoError (t , err )
240241 assert .Equal (t , expect , got )
@@ -337,7 +338,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
337338 ` )),
338339 withCmdLineFlags ("--credentials-file" , path ))
339340 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 )
341342 assert .IsType (t , & client.OAuthClient {}, cl )
342343 })
343344
@@ -411,7 +412,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
411412 ` )),
412413 withCmdLineFlags ("--client-id" , "5bc7d07c-45da-11ef-a878-523f1e1d7de1" , "--private-key-path" , path ))
413414 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 )
415416 assert .IsType (t , & client.VenafiCloudClient {}, cl )
416417 })
417418
@@ -432,7 +433,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
432433 ` )),
433434 withCmdLineFlags ("--venafi-cloud" , "--credentials-file" , credsPath ))
434435 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 )
436437 })
437438
438439 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) {
503504 withCmdLineFlags ("--install-namespace" , "venafi" , "--venafi-connection" , "venafi-components" ))
504505 require .NoError (t , err )
505506 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 ,
512514 }, got )
513515 assert .IsType (t , & client.VenConnClient {}, cl )
514516 })
0 commit comments