Skip to content

Commit 02423cb

Browse files
willbroadbeltbrett19
authored andcommitted
Add 'force-path-style' to AnalyticsBlobStorage settings
This needs to be set to true on the latest Analytics builds
1 parent e13c8a2 commit 02423cb

4 files changed

Lines changed: 48 additions & 38 deletions

File tree

clusterdef/cluster.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ type AnalyticsSettings struct {
3737
}
3838

3939
type AnalyticsBlobStorageSettings struct {
40-
Region string `yaml:"region,omitempty"`
41-
Prefix string `yaml:"prefix,omitempty"`
42-
Bucket string `yaml:"bucket,omitempty"`
43-
Scheme string `yaml:"scheme,omitempty"`
44-
Endpoint string `yaml:"endpoint,omitempty"`
45-
AnonymousAuth bool `yaml:"anonymous-auth,omitempty"`
40+
Region string `yaml:"region,omitempty"`
41+
Prefix string `yaml:"prefix,omitempty"`
42+
Bucket string `yaml:"bucket,omitempty"`
43+
Scheme string `yaml:"scheme,omitempty"`
44+
Endpoint string `yaml:"endpoint,omitempty"`
45+
AnonymousAuth bool `yaml:"anonymous-auth,omitempty"`
46+
ForcePathStyle bool `yaml:"force-path-style,omitempty"`
4647
}
4748

4849
type CaoCluster struct {

deployment/dockerdeploy/deployer.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,12 @@ func (d *Deployer) NewCluster(ctx context.Context, def *clusterdef.Cluster) (dep
360360
d.logger.Info("s3 mock is ready")
361361

362362
def.Docker.Analytics.BlobStorage = clusterdef.AnalyticsBlobStorageSettings{
363-
Region: "local",
364-
Bucket: "columnar",
365-
Scheme: "s3",
366-
Endpoint: fmt.Sprintf("http://%s:9090", node.IPAddress),
367-
AnonymousAuth: true,
363+
Region: "local",
364+
Bucket: "columnar",
365+
Scheme: "s3",
366+
Endpoint: fmt.Sprintf("http://%s:9090", node.IPAddress),
367+
AnonymousAuth: true,
368+
ForcePathStyle: true,
368369
}
369370
}
370371

@@ -659,12 +660,13 @@ func (d *Deployer) NewCluster(ctx context.Context, def *clusterdef.Cluster) (dep
659660
}
660661

661662
analyticsSettings := clustercontrol.AnalyticsSettings{
662-
BlobStorageRegion: def.Docker.Analytics.BlobStorage.Region,
663-
BlobStoragePrefix: def.Docker.Analytics.BlobStorage.Prefix,
664-
BlobStorageBucket: def.Docker.Analytics.BlobStorage.Bucket,
665-
BlobStorageScheme: def.Docker.Analytics.BlobStorage.Scheme,
666-
BlobStorageEndpoint: def.Docker.Analytics.BlobStorage.Endpoint,
667-
BlobStorageAnonymousAuth: def.Docker.Analytics.BlobStorage.AnonymousAuth,
663+
BlobStorageRegion: def.Docker.Analytics.BlobStorage.Region,
664+
BlobStoragePrefix: def.Docker.Analytics.BlobStorage.Prefix,
665+
BlobStorageBucket: def.Docker.Analytics.BlobStorage.Bucket,
666+
BlobStorageScheme: def.Docker.Analytics.BlobStorage.Scheme,
667+
BlobStorageEndpoint: def.Docker.Analytics.BlobStorage.Endpoint,
668+
BlobStorageAnonymousAuth: def.Docker.Analytics.BlobStorage.AnonymousAuth,
669+
BlobStorageForcePathStyle: def.Docker.Analytics.BlobStorage.ForcePathStyle,
668670
}
669671
d.logger.Debug("analytics configuration", zap.Any("settings", analyticsSettings))
670672

utils/clustercontrol/controller.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,13 @@ func (c *Controller) UpdateWebSettings(ctx context.Context, opts *UpdateWebSetti
302302
}
303303

304304
type SetupAnalyticsOptions struct {
305-
BlobStorageRegion string
306-
BlobStoragePrefix string
307-
BlobStorageBucket string
308-
BlobStorageScheme string
309-
BlobStorageEndpoint string
310-
BlobStorageAnonymousAuth bool
305+
BlobStorageRegion string
306+
BlobStoragePrefix string
307+
BlobStorageBucket string
308+
BlobStorageScheme string
309+
BlobStorageEndpoint string
310+
BlobStorageAnonymousAuth bool
311+
BlobStorageForcePathStyle bool
311312
}
312313

313314
func (c *Controller) SetupAnalytics(ctx context.Context, opts *SetupAnalyticsOptions) error {
@@ -316,7 +317,8 @@ func (c *Controller) SetupAnalytics(ctx context.Context, opts *SetupAnalyticsOpt
316317
opts.BlobStorageRegion == "" &&
317318
opts.BlobStorageScheme == "" &&
318319
opts.BlobStorageEndpoint == "" &&
319-
!opts.BlobStorageAnonymousAuth {
320+
!opts.BlobStorageAnonymousAuth &&
321+
!opts.BlobStorageForcePathStyle {
320322
return nil
321323
}
322324

@@ -330,6 +332,9 @@ func (c *Controller) SetupAnalytics(ctx context.Context, opts *SetupAnalyticsOpt
330332
if opts.BlobStorageAnonymousAuth {
331333
form.Add("blobStorageAnonymousAuth", "true")
332334
}
335+
if opts.BlobStorageForcePathStyle {
336+
form.Add("blobStorageForcePathStyle", "true")
337+
}
333338
return c.doFormPost(ctx, "/settings/analytics", form, true, nil)
334339
}
335340

utils/clustercontrol/nodemanager.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ func (m *NodeManager) WaitForOnline(ctx context.Context) error {
3939
}
4040

4141
type AnalyticsSettings struct {
42-
BlobStorageRegion string
43-
BlobStoragePrefix string
44-
BlobStorageBucket string
45-
BlobStorageScheme string
46-
BlobStorageEndpoint string
47-
BlobStorageAnonymousAuth bool
42+
BlobStorageRegion string
43+
BlobStoragePrefix string
44+
BlobStorageBucket string
45+
BlobStorageScheme string
46+
BlobStorageEndpoint string
47+
BlobStorageAnonymousAuth bool
48+
BlobStorageForcePathStyle bool
4849
}
4950

5051
type SetupOneNodeClusterOptions struct {
@@ -57,8 +58,8 @@ type SetupOneNodeClusterOptions struct {
5758
Username string
5859
Password string
5960

60-
Services []string
61-
ServerGroup string
61+
Services []string
62+
ServerGroup string
6263
AnalyticsSettings AnalyticsSettings
6364
}
6465

@@ -91,12 +92,13 @@ func (m *NodeManager) SetupOneNodeCluster(ctx context.Context, opts *SetupOneNod
9192
}
9293

9394
err = c.SetupAnalytics(ctx, &SetupAnalyticsOptions{
94-
BlobStorageRegion: opts.AnalyticsSettings.BlobStorageRegion,
95-
BlobStoragePrefix: opts.AnalyticsSettings.BlobStoragePrefix,
96-
BlobStorageBucket: opts.AnalyticsSettings.BlobStorageBucket,
97-
BlobStorageScheme: opts.AnalyticsSettings.BlobStorageScheme,
98-
BlobStorageEndpoint: opts.AnalyticsSettings.BlobStorageEndpoint,
99-
BlobStorageAnonymousAuth: opts.AnalyticsSettings.BlobStorageAnonymousAuth,
95+
BlobStorageRegion: opts.AnalyticsSettings.BlobStorageRegion,
96+
BlobStoragePrefix: opts.AnalyticsSettings.BlobStoragePrefix,
97+
BlobStorageBucket: opts.AnalyticsSettings.BlobStorageBucket,
98+
BlobStorageScheme: opts.AnalyticsSettings.BlobStorageScheme,
99+
BlobStorageEndpoint: opts.AnalyticsSettings.BlobStorageEndpoint,
100+
BlobStorageAnonymousAuth: opts.AnalyticsSettings.BlobStorageAnonymousAuth,
101+
BlobStorageForcePathStyle: opts.AnalyticsSettings.BlobStorageForcePathStyle,
100102
})
101103
if err != nil {
102104
return errors.Wrap(err, "failed to configure analytics settings")

0 commit comments

Comments
 (0)