@@ -17,12 +17,29 @@ type (
1717 S3Protocol * s3Protocol `toml:"s3_protocol"`
1818 S3Credentials storageS3Credentials `toml:"-"`
1919 Buckets BucketConfig `toml:"buckets"`
20+ AnalyticsBuckets analyticsBuckets `toml:"analytics"`
21+ VectorBuckets vectorBuckets `toml:"vector"`
2022 }
2123
2224 imageTransformation struct {
2325 Enabled bool `toml:"enabled"`
2426 }
2527
28+ analyticsBuckets struct {
29+ Enabled bool `toml:"enabled"`
30+ MaxNamespaces uint `toml:"max_namespaces"`
31+ MaxTables uint `toml:"max_tables"`
32+ MaxCatalogs uint `toml:"max_catalogs"`
33+ Buckets map [string ]struct {} `toml:"buckets"`
34+ }
35+
36+ vectorBuckets struct {
37+ Enabled bool `toml:"enabled"`
38+ MaxBuckets uint `toml:"max_buckets"`
39+ MaxIndexes uint `toml:"max_indexes"`
40+ Buckets map [string ]struct {} `toml:"buckets"`
41+ }
42+
2643 s3Protocol struct {
2744 Enabled bool `toml:"enabled"`
2845 }
@@ -68,10 +85,43 @@ func (s *storage) ToUpdateStorageConfigBody() v1API.UpdateStorageConfigBody {
6885 }
6986 // When local config is not set, we assume platform defaults should not change
7087 if s .ImageTransformation != nil {
71- body .Features .ImageTransformation .Enabled = s .ImageTransformation .Enabled
88+ body .Features .ImageTransformation = & struct {
89+ Enabled bool `json:"enabled"`
90+ }{
91+ Enabled : s .ImageTransformation .Enabled ,
92+ }
93+ }
94+ // Disabling analytics and vector buckets means leaving platform values unchanged
95+ if s .AnalyticsBuckets .Enabled {
96+ body .Features .IcebergCatalog = & struct {
97+ Enabled bool `json:"enabled"`
98+ MaxCatalogs int `json:"maxCatalogs"`
99+ MaxNamespaces int `json:"maxNamespaces"`
100+ MaxTables int `json:"maxTables"`
101+ }{
102+ Enabled : true ,
103+ MaxNamespaces : cast .UintToInt (s .AnalyticsBuckets .MaxNamespaces ),
104+ MaxTables : cast .UintToInt (s .AnalyticsBuckets .MaxTables ),
105+ MaxCatalogs : cast .UintToInt (s .AnalyticsBuckets .MaxCatalogs ),
106+ }
107+ }
108+ if s .VectorBuckets .Enabled {
109+ body .Features .VectorBuckets = & struct {
110+ Enabled bool `json:"enabled"`
111+ MaxBuckets int `json:"maxBuckets"`
112+ MaxIndexes int `json:"maxIndexes"`
113+ }{
114+ Enabled : true ,
115+ MaxBuckets : cast .UintToInt (s .VectorBuckets .MaxBuckets ),
116+ MaxIndexes : cast .UintToInt (s .VectorBuckets .MaxIndexes ),
117+ }
72118 }
73119 if s .S3Protocol != nil {
74- body .Features .S3Protocol .Enabled = s .S3Protocol .Enabled
120+ body .Features .S3Protocol = & struct {
121+ Enabled bool `json:"enabled"`
122+ }{
123+ Enabled : s .S3Protocol .Enabled ,
124+ }
75125 }
76126 return body
77127}
@@ -83,6 +133,17 @@ func (s *storage) FromRemoteStorageConfig(remoteConfig v1API.StorageConfigRespon
83133 if s .ImageTransformation != nil {
84134 s .ImageTransformation .Enabled = remoteConfig .Features .ImageTransformation .Enabled
85135 }
136+ if s .AnalyticsBuckets .Enabled {
137+ s .AnalyticsBuckets .Enabled = remoteConfig .Features .IcebergCatalog .Enabled
138+ s .AnalyticsBuckets .MaxNamespaces = cast .IntToUint (remoteConfig .Features .IcebergCatalog .MaxNamespaces )
139+ s .AnalyticsBuckets .MaxTables = cast .IntToUint (remoteConfig .Features .IcebergCatalog .MaxTables )
140+ s .AnalyticsBuckets .MaxCatalogs = cast .IntToUint (remoteConfig .Features .IcebergCatalog .MaxCatalogs )
141+ }
142+ if s .VectorBuckets .Enabled {
143+ s .VectorBuckets .Enabled = remoteConfig .Features .VectorBuckets .Enabled
144+ s .VectorBuckets .MaxBuckets = cast .IntToUint (remoteConfig .Features .VectorBuckets .MaxBuckets )
145+ s .VectorBuckets .MaxIndexes = cast .IntToUint (remoteConfig .Features .VectorBuckets .MaxIndexes )
146+ }
86147 if s .S3Protocol != nil {
87148 s .S3Protocol .Enabled = remoteConfig .Features .S3Protocol .Enabled
88149 }
0 commit comments