@@ -45,11 +45,11 @@ func validatePullPolicy(v v1.PullPolicy) error {
45
45
46
46
// DeploymentSpec contains the spec part of a ArangoDeployment resource.
47
47
type DeploymentSpec struct {
48
- XMode * DeploymentMode `json:"mode,omitempty"`
49
- XEnvironment * Environment `json:"environment,omitempty"`
50
- XStorageEngine * StorageEngine `json:"storageEngine,omitempty"`
51
- XImage * string `json:"image,omitempty"`
52
- XImagePullPolicy * v1.PullPolicy `json:"imagePullPolicy,omitempty"`
48
+ Mode * DeploymentMode `json:"mode,omitempty"`
49
+ Environment * Environment `json:"environment,omitempty"`
50
+ StorageEngine * StorageEngine `json:"storageEngine,omitempty"`
51
+ Image * string `json:"image,omitempty"`
52
+ ImagePullPolicy * v1.PullPolicy `json:"imagePullPolicy,omitempty"`
53
53
54
54
RocksDB RocksDBSpec `json:"rocksdb"`
55
55
Authentication AuthenticationSpec `json:"auth"`
@@ -66,27 +66,27 @@ type DeploymentSpec struct {
66
66
67
67
// GetMode returns the value of mode.
68
68
func (s DeploymentSpec ) GetMode () DeploymentMode {
69
- return ModeOrDefault (s .XMode )
69
+ return ModeOrDefault (s .Mode )
70
70
}
71
71
72
72
// GetEnvironment returns the value of environment.
73
73
func (s DeploymentSpec ) GetEnvironment () Environment {
74
- return EnvironmentOrDefault (s .XEnvironment )
74
+ return EnvironmentOrDefault (s .Environment )
75
75
}
76
76
77
77
// GetStorageEngine returns the value of storageEngine.
78
78
func (s DeploymentSpec ) GetStorageEngine () StorageEngine {
79
- return StorageEngineOrDefault (s .XStorageEngine )
79
+ return StorageEngineOrDefault (s .StorageEngine )
80
80
}
81
81
82
82
// GetImage returns the value of image.
83
83
func (s DeploymentSpec ) GetImage () string {
84
- return util .StringOrDefault (s .XImage )
84
+ return util .StringOrDefault (s .Image )
85
85
}
86
86
87
87
// GetImagePullPolicy returns the value of imagePullPolicy.
88
88
func (s DeploymentSpec ) GetImagePullPolicy () v1.PullPolicy {
89
- return util .PullPolicyOrDefault (s .XImagePullPolicy )
89
+ return util .PullPolicyOrDefault (s .ImagePullPolicy )
90
90
}
91
91
92
92
// IsAuthenticated returns true when authentication is enabled
@@ -123,19 +123,19 @@ func (s DeploymentSpec) GetServerGroupSpec(group ServerGroup) ServerGroupSpec {
123
123
// SetDefaults fills in default values when a field is not specified.
124
124
func (s * DeploymentSpec ) SetDefaults (deploymentName string ) {
125
125
if s .GetMode () == "" {
126
- s .XMode = NewMode (DeploymentModeCluster )
126
+ s .Mode = NewMode (DeploymentModeCluster )
127
127
}
128
128
if s .GetEnvironment () == "" {
129
- s .XEnvironment = NewEnvironment (EnvironmentDevelopment )
129
+ s .Environment = NewEnvironment (EnvironmentDevelopment )
130
130
}
131
131
if s .GetStorageEngine () == "" {
132
- s .XStorageEngine = NewStorageEngine (StorageEngineRocksDB )
132
+ s .StorageEngine = NewStorageEngine (StorageEngineRocksDB )
133
133
}
134
134
if s .GetImage () == "" && s .IsDevelopment () {
135
- s .XImage = util .NewString (defaultImage )
135
+ s .Image = util .NewString (defaultImage )
136
136
}
137
137
if s .GetImagePullPolicy () == "" {
138
- s .XImagePullPolicy = util .NewPullPolicy (v1 .PullIfNotPresent )
138
+ s .ImagePullPolicy = util .NewPullPolicy (v1 .PullIfNotPresent )
139
139
}
140
140
s .RocksDB .SetDefaults ()
141
141
s .Authentication .SetDefaults (deploymentName + "-jwt" )
@@ -151,20 +151,20 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) {
151
151
152
152
// SetDefaultsFrom fills unspecified fields with a value from given source spec.
153
153
func (s * DeploymentSpec ) SetDefaultsFrom (source DeploymentSpec ) {
154
- if s .XMode == nil {
155
- s .XMode = NewModeOrNil (source .XMode )
154
+ if s .Mode == nil {
155
+ s .Mode = NewModeOrNil (source .Mode )
156
156
}
157
- if s .XEnvironment == nil {
158
- s .XEnvironment = NewEnvironmentOrNil (source .XEnvironment )
157
+ if s .Environment == nil {
158
+ s .Environment = NewEnvironmentOrNil (source .Environment )
159
159
}
160
- if s .XStorageEngine == nil {
161
- s .XStorageEngine = NewStorageEngineOrNil (source .XStorageEngine )
160
+ if s .StorageEngine == nil {
161
+ s .StorageEngine = NewStorageEngineOrNil (source .StorageEngine )
162
162
}
163
- if s .XImage == nil {
164
- s .XImage = util .NewStringOrNil (source .XImage )
163
+ if s .Image == nil {
164
+ s .Image = util .NewStringOrNil (source .Image )
165
165
}
166
- if s .XImagePullPolicy == nil {
167
- s .XImagePullPolicy = util .NewPullPolicyOrNil (source .XImagePullPolicy )
166
+ if s .ImagePullPolicy == nil {
167
+ s .ImagePullPolicy = util .NewPullPolicyOrNil (source .ImagePullPolicy )
168
168
}
169
169
s .RocksDB .SetDefaultsFrom (source .RocksDB )
170
170
s .Authentication .SetDefaultsFrom (source .Authentication )
@@ -240,11 +240,11 @@ func (s DeploymentSpec) IsDevelopment() bool {
240
240
func (s DeploymentSpec ) ResetImmutableFields (target * DeploymentSpec ) []string {
241
241
var resetFields []string
242
242
if s .GetMode () != target .GetMode () {
243
- target .XMode = NewModeOrNil (s .XMode )
243
+ target .Mode = NewModeOrNil (s .Mode )
244
244
resetFields = append (resetFields , "mode" )
245
245
}
246
246
if s .GetStorageEngine () != target .GetStorageEngine () {
247
- target .XStorageEngine = NewStorageEngineOrNil (s .XStorageEngine )
247
+ target .StorageEngine = NewStorageEngineOrNil (s .StorageEngine )
248
248
resetFields = append (resetFields , "storageEngine" )
249
249
}
250
250
if l := s .RocksDB .ResetImmutableFields ("rocksdb" , & target .RocksDB ); l != nil {
0 commit comments