@@ -31,6 +31,7 @@ import (
31
31
"google.golang.org/grpc/internal/testutils"
32
32
"google.golang.org/grpc/resolver"
33
33
xdsclient "google.golang.org/grpc/xds/internal/client"
34
+ "google.golang.org/grpc/xds/internal/client/bootstrap"
34
35
xdstestutils "google.golang.org/grpc/xds/internal/testutils"
35
36
"google.golang.org/grpc/xds/internal/testutils/fakeclient"
36
37
)
@@ -43,7 +44,7 @@ const (
43
44
44
45
var (
45
46
fpb1 , fpb2 * fakeProviderBuilder
46
- bootstrapCertProviderConfigs map [ string ] * certprovider. BuildableConfig
47
+ bootstrapConfig * bootstrap. Config
47
48
cdsUpdateWithGoodSecurityCfg = xdsclient.ClusterUpdate {
48
49
ServiceName : serviceName ,
49
50
SecurityCfg : & xdsclient.SecurityConfig {
@@ -64,9 +65,11 @@ func init() {
64
65
fpb2 = & fakeProviderBuilder {name : fakeProvider2Name }
65
66
cfg1 , _ := fpb1 .ParseConfig (fakeConfig + "1111" )
66
67
cfg2 , _ := fpb2 .ParseConfig (fakeConfig + "2222" )
67
- bootstrapCertProviderConfigs = map [string ]* certprovider.BuildableConfig {
68
- "default1" : cfg1 ,
69
- "default2" : cfg2 ,
68
+ bootstrapConfig = & bootstrap.Config {
69
+ CertProviderConfigs : map [string ]* certprovider.BuildableConfig {
70
+ "default1" : cfg1 ,
71
+ "default2" : cfg2 ,
72
+ },
70
73
}
71
74
certprovider .Register (fpb1 )
72
75
certprovider .Register (fpb2 )
@@ -326,7 +329,7 @@ func (s) TestSecurityConfigNotFoundInBootstrap(t *testing.T) {
326
329
327
330
if i == 0 {
328
331
// Set the bootstrap config used by the fake client.
329
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
332
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
330
333
}
331
334
332
335
// Here we invoke the watch callback registered on the fake xdsClient. A bad
@@ -373,7 +376,7 @@ func (s) TestCertproviderStoreError(t *testing.T) {
373
376
defer func () { buildProvider = origBuildProvider }()
374
377
375
378
// Set the bootstrap config used by the fake client.
376
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
379
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
377
380
378
381
// Here we invoke the watch callback registered on the fake xdsClient. Even
379
382
// though the received update is good, the certprovider.Store is configured
@@ -409,7 +412,7 @@ func (s) TestSecurityConfigUpdate_BadToGood(t *testing.T) {
409
412
}()
410
413
411
414
// Set the bootstrap config used by the fake client.
412
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
415
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
413
416
414
417
// Here we invoke the watch callback registered on the fake xdsClient. A bad
415
418
// security config is passed here. So, we expect the CDS balancer to not
@@ -465,7 +468,7 @@ func (s) TestGoodSecurityConfig(t *testing.T) {
465
468
}()
466
469
467
470
// Set the bootstrap config used by the fake client.
468
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
471
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
469
472
470
473
// Here we invoke the watch callback registered on the fake xdsClient. This
471
474
// will trigger the watch handler on the CDS balancer, which will attempt to
@@ -496,7 +499,7 @@ func (s) TestSecurityConfigUpdate_GoodToFallback(t *testing.T) {
496
499
}()
497
500
498
501
// Set the bootstrap config used by the fake client.
499
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
502
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
500
503
501
504
// Here we invoke the watch callback registered on the fake xdsClient. This
502
505
// will trigger the watch handler on the CDS balancer, which will attempt to
@@ -546,7 +549,7 @@ func (s) TestSecurityConfigUpdate_GoodToBad(t *testing.T) {
546
549
}()
547
550
548
551
// Set the bootstrap config used by the fake client.
549
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
552
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
550
553
551
554
// Here we invoke the watch callback registered on the fake xdsClient. This
552
555
// will trigger the watch handler on the CDS balancer, which will attempt to
@@ -617,7 +620,7 @@ func (s) TestSecurityConfigUpdate_GoodToGood(t *testing.T) {
617
620
defer func () { buildProvider = origBuildProvider }()
618
621
619
622
// Set the bootstrap config used by the fake client.
620
- xdsC .SetCertProviderConfigs ( bootstrapCertProviderConfigs )
623
+ xdsC .SetBootstrapConfig ( bootstrapConfig )
621
624
622
625
// Here we invoke the watch callback registered on the fake xdsClient. This
623
626
// will trigger the watch handler on the CDS balancer, which will attempt to
0 commit comments