Skip to content

Commit 94e9d82

Browse files
committed
revert walle_location rename
1 parent 008ed37 commit 94e9d82

File tree

5 files changed

+19
-34
lines changed

5 files changed

+19
-34
lines changed

api/v1alpha1/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func generateSomeDefaults(cr *Storage, crDB *Database) schema.Configuration {
3939
HostConfigID: 1, // TODO
4040
NodeID: i + 1,
4141
Port: InterconnectPort,
42-
Location: schema.Location{
42+
WalleLocation: schema.WalleLocation{
4343
Body: 12340 + i,
4444
DataCenter: datacenter,
4545
Rack: strconv.Itoa(i),

internal/configuration/schema/host.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package schema
22

33
type Host struct {
4-
Address string `yaml:"address,omitempty"`
5-
Host string `yaml:"host"`
6-
HostConfigID int `yaml:"host_config_id"`
7-
NodeID int `yaml:"node_id"`
8-
Port int `yaml:"port,omitempty"`
9-
Location Location `yaml:"location,omitempty"`
4+
Address string `yaml:"address,omitempty"`
5+
Host string `yaml:"host"`
6+
HostConfigID int `yaml:"host_config_id"`
7+
NodeID int `yaml:"node_id"`
8+
Port int `yaml:"port,omitempty"`
9+
WalleLocation WalleLocation `yaml:"walle_location,omitempty"`
1010
}
1111

12-
type Location struct {
12+
type WalleLocation struct {
1313
Body int `yaml:"body"`
1414
DataCenter string `yaml:"data_center"`
1515
Rack string `yaml:"rack"`

internal/configuration/schema/schema_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ var configurationExample = `
1616
---
1717
hosts:
1818
- host: storage-0
19-
location: {body: 0, data_center: 'dcExample', rack: '0'}
19+
walle_location: {body: 0, data_center: 'dcExample', rack: '0'}
2020
node_id: 1
2121
host_config_id: 1
2222
- host: storage-1
23-
location: {body: 1, data_center: 'dcExample', rack: '1'}
23+
walle_location: {body: 1, data_center: 'dcExample', rack: '1'}
2424
node_id: 2
2525
host_config_id: 1
2626
- host: storage-2
27-
location: {body: 2, data_center: 'dcExample', rack: '2'}
27+
walle_location: {body: 2, data_center: 'dcExample', rack: '2'}
2828
node_id: 3
2929
host_config_id: 1
3030
- host: storage-3
31-
location: {body: 3, data_center: 'dcExample', rack: '3'}
31+
walle_location: {body: 3, data_center: 'dcExample', rack: '3'}
3232
node_id: 4
3333
host_config_id: 1
3434
- host: storage-4
35-
location: {body: 4, data_center: 'dcExample', rack: '4'}
35+
walle_location: {body: 4, data_center: 'dcExample', rack: '4'}
3636
node_id: 5
3737
host_config_id: 1
3838
- host: storage-5
39-
location: {body: 5, data_center: 'dcExample', rack: '5'}
39+
walle_location: {body: 5, data_center: 'dcExample', rack: '5'}
4040
node_id: 6
4141
host_config_id: 1
4242
- host: storage-6
43-
location: {body: 6, data_center: 'dcExample', rack: '6'}
43+
walle_location: {body: 6, data_center: 'dcExample', rack: '6'}
4444
node_id: 7
4545
host_config_id: 1
4646
- host: storage-7
47-
location: {body: 7, data_center: 'dcExample', rack: '7'}
47+
walle_location: {body: 7, data_center: 'dcExample', rack: '7'}
4848
node_id: 8
4949
host_config_id: 1
5050
key_config:
@@ -95,7 +95,7 @@ var _ = Describe("Testing schema", func() {
9595
Host: fmt.Sprintf("storage-%d", i),
9696
NodeID: i + 1,
9797
HostConfigID: 1,
98-
Location: schema.Location{
98+
Location: schema.WalleLocation{
9999
Body: i,
100100
DataCenter: "dcExample",
101101
Rack: fmt.Sprint(i),

internal/resources/resource.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const (
4545
interconnectTLSVolumeMountPath = "/tls/interconnect"
4646
datastreamsTLSVolumeMountPath = "/tls/datastreams"
4747

48-
DynConfigNameFormat = "%s-dynconfig"
4948
InitJobNameFormat = "%s-blobstorage-init"
5049
OperatorTokenSecretNameFormat = "%s-operator-token"
5150

internal/resources/storage.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package resources
22

33
import (
4-
"fmt"
5-
64
"gopkg.in/yaml.v3"
75
corev1 "k8s.io/api/core/v1"
86
"k8s.io/client-go/rest"
@@ -57,26 +55,14 @@ func (b *StorageClusterBuilder) GetResourceBuilders(restConfig *rest.Config) []R
5755
},
5856
)
5957
} else {
60-
// error was previously handled in the ValidationWebhook
61-
staticConfig, _ := yaml.Marshal(dynConfig.Config)
58+
cfg, _ := yaml.Marshal(dynConfig.Config)
6259
optionalBuilders = append(
6360
optionalBuilders,
6461
&ConfigMapBuilder{
6562
Object: b,
6663
Name: b.Storage.GetName(),
6764
Data: map[string]string{
68-
api.ConfigFileName: string(staticConfig),
69-
},
70-
Labels: storageLabels,
71-
},
72-
)
73-
optionalBuilders = append(
74-
optionalBuilders,
75-
&ConfigMapBuilder{
76-
Object: b,
77-
Name: fmt.Sprintf(DynConfigNameFormat, b.Storage.GetName()),
78-
Data: map[string]string{
79-
api.DynconfigFileName: b.Spec.Configuration,
65+
api.ConfigFileName: string(cfg),
8066
},
8167
Labels: storageLabels,
8268
},

0 commit comments

Comments
 (0)