@@ -73,12 +73,8 @@ func (rm *resourceManager) customUpdateDomain(ctx context.Context, desired, late
73
73
advancedOptions = make (map [string ]* string )
74
74
advancedOptions [allowedAdvancedOption ] = desired .ko .Spec .AdvancedOptions [allowedAdvancedOption ]
75
75
}
76
- advancedOptions_string := make (map [string ]string )
77
- for k , v := range advancedOptions {
78
- advancedOptions_string [k ] = * v
79
- }
80
76
resp , err := rm .sdkapi .UpgradeDomain (ctx , & svcsdk.UpgradeDomainInput {
81
- AdvancedOptions : advancedOptions_string ,
77
+ AdvancedOptions : aws . ToStringMap ( advancedOptions ) ,
82
78
DomainName : latest .ko .Spec .Name ,
83
79
PerformCheckOnly : nil ,
84
80
TargetVersion : desired .ko .Spec .EngineVersion ,
@@ -203,23 +199,36 @@ func (rm *resourceManager) customUpdateDomain(ctx context.Context, desired, late
203
199
}
204
200
var zaConfig * v1alpha1.ZoneAwarenessConfig
205
201
if resp .DomainConfig .ClusterConfig .Options .ZoneAwarenessConfig != nil {
206
- zaConfig = & v1alpha1.ZoneAwarenessConfig {
207
- AvailabilityZoneCount : aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .ZoneAwarenessConfig .AvailabilityZoneCount )),
202
+ zaConfig = & v1alpha1.ZoneAwarenessConfig {}
203
+ if resp .DomainConfig .ClusterConfig .Options .ZoneAwarenessConfig .AvailabilityZoneCount != nil {
204
+ zaConfig .AvailabilityZoneCount = aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .ZoneAwarenessConfig .AvailabilityZoneCount ))
208
205
}
209
206
}
210
207
ko .Spec .ClusterConfig = & v1alpha1.ClusterConfig {
211
208
ColdStorageOptions : csOptions ,
212
- DedicatedMasterCount : aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .DedicatedMasterCount )),
213
209
DedicatedMasterEnabled : resp .DomainConfig .ClusterConfig .Options .DedicatedMasterEnabled ,
214
- DedicatedMasterType : aws .String (string (resp .DomainConfig .ClusterConfig .Options .DedicatedMasterType )),
215
- InstanceCount : aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .InstanceCount )),
216
- InstanceType : aws .String (string (resp .DomainConfig .ClusterConfig .Options .InstanceType )),
217
- WarmCount : aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .WarmCount )),
218
210
WarmEnabled : resp .DomainConfig .ClusterConfig .Options .WarmEnabled ,
219
- WarmType : aws .String (string (resp .DomainConfig .ClusterConfig .Options .WarmType )),
220
211
ZoneAwarenessConfig : zaConfig ,
221
212
ZoneAwarenessEnabled : resp .DomainConfig .ClusterConfig .Options .ZoneAwarenessEnabled ,
222
213
}
214
+ if resp .DomainConfig .ClusterConfig .Options .DedicatedMasterCount != nil {
215
+ ko .Spec .ClusterConfig .DedicatedMasterCount = aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .DedicatedMasterCount ))
216
+ }
217
+ if resp .DomainConfig .ClusterConfig .Options .DedicatedMasterType != "" {
218
+ ko .Spec .ClusterConfig .DedicatedMasterType = aws .String (string (resp .DomainConfig .ClusterConfig .Options .DedicatedMasterType ))
219
+ }
220
+ if resp .DomainConfig .ClusterConfig .Options .InstanceCount != nil {
221
+ ko .Spec .ClusterConfig .InstanceCount = aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .InstanceCount ))
222
+ }
223
+ if resp .DomainConfig .ClusterConfig .Options .InstanceType != "" {
224
+ ko .Spec .ClusterConfig .InstanceType = aws .String (string (resp .DomainConfig .ClusterConfig .Options .InstanceType ))
225
+ }
226
+ if resp .DomainConfig .ClusterConfig .Options .WarmCount != nil {
227
+ ko .Spec .ClusterConfig .WarmCount = aws .Int64 (int64 (* resp .DomainConfig .ClusterConfig .Options .WarmCount ))
228
+ }
229
+ if resp .DomainConfig .ClusterConfig .Options .WarmType != "" {
230
+ ko .Spec .ClusterConfig .WarmType = aws .String (string (resp .DomainConfig .ClusterConfig .Options .WarmType ))
231
+ }
223
232
} else {
224
233
ko .Spec .ClusterConfig = nil
225
234
}
@@ -247,10 +256,18 @@ func (rm *resourceManager) customUpdateDomain(ctx context.Context, desired, late
247
256
if resp .DomainConfig .EBSOptions != nil {
248
257
ko .Spec .EBSOptions = & v1alpha1.EBSOptions {
249
258
EBSEnabled : resp .DomainConfig .EBSOptions .Options .EBSEnabled ,
250
- IOPS : aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .Iops )),
251
- Throughput : aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .Throughput )),
252
- VolumeSize : aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .VolumeSize )),
253
- VolumeType : aws .String (string (resp .DomainConfig .EBSOptions .Options .VolumeType )),
259
+ }
260
+ if resp .DomainConfig .EBSOptions .Options .Iops != nil {
261
+ ko .Spec .EBSOptions .IOPS = aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .Iops ))
262
+ }
263
+ if resp .DomainConfig .EBSOptions .Options .Throughput != nil {
264
+ ko .Spec .EBSOptions .Throughput = aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .Throughput ))
265
+ }
266
+ if resp .DomainConfig .EBSOptions .Options .VolumeSize != nil {
267
+ ko .Spec .EBSOptions .VolumeSize = aws .Int64 (int64 (* resp .DomainConfig .EBSOptions .Options .VolumeSize ))
268
+ }
269
+ if resp .DomainConfig .EBSOptions .Options .VolumeType != "" {
270
+ ko .Spec .EBSOptions .VolumeType = aws .String (string (resp .DomainConfig .EBSOptions .Options .VolumeType ))
254
271
}
255
272
} else {
256
273
ko .Spec .EBSOptions = nil
0 commit comments