@@ -195,7 +195,7 @@ func (rm *resourceManager) updateNumberOfBrokerNodes(
195
195
_ , err = rm .sdkapi .UpdateBrokerCount (ctx , & svcsdk.UpdateBrokerCountInput {
196
196
ClusterArn : (* string )(latest .ko .Status .ACKResourceMetadata .ARN ),
197
197
CurrentVersion : latest .ko .Status .CurrentVersion ,
198
- TargetNumberOfBrokerNodes : aws . Int32 ( int32 ( * desired .ko .Spec .NumberOfBrokerNodes ) ),
198
+ TargetNumberOfBrokerNodes : int32OrNil ( desired .ko .Spec .NumberOfBrokerNodes ),
199
199
})
200
200
rm .metrics .RecordAPICall ("UPDATE" , "UpdateBrokerCount" , err )
201
201
if err != nil {
@@ -207,8 +207,7 @@ func (rm *resourceManager) updateNumberOfBrokerNodes(
207
207
return desired , requeueAfterAsyncUpdate ()
208
208
}
209
209
210
-
211
- // updateBrokerType updates the broker type of the
210
+ // updateBrokerType updates the broker type of the
212
211
// kafka cluster
213
212
func (rm * resourceManager ) updateBrokerType (
214
213
ctx context.Context ,
@@ -250,7 +249,7 @@ func (rm *resourceManager) updateBrokerStorage(
250
249
TargetBrokerEBSVolumeInfo : []svcsdktypes.BrokerEBSVolumeInfo {
251
250
{
252
251
KafkaBrokerNodeId : aws .String ("ALL" ),
253
- VolumeSizeGB : aws . Int32 ( int32 ( * desired .ko .Spec .BrokerNodeGroupInfo .StorageInfo .EBSStorageInfo .VolumeSize ) ),
252
+ VolumeSizeGB : int32OrNil ( desired .ko .Spec .BrokerNodeGroupInfo .StorageInfo .EBSStorageInfo .VolumeSize ),
254
253
},
255
254
},
256
255
})
@@ -327,7 +326,7 @@ func (rm *resourceManager) updateClientAuthentication(
327
326
}
328
327
message := "kafka is updating the client authentication"
329
328
ackcondition .SetSynced (desired , corev1 .ConditionFalse , & message , nil )
330
-
329
+
331
330
return desired , err
332
331
}
333
332
@@ -415,7 +414,7 @@ func (rm *resourceManager) getAssociatedScramSecrets(
415
414
return res , err
416
415
}
417
416
418
- // unprocessedSecrets is an error returned by the
417
+ // unprocessedSecrets is an error returned by the
419
418
// BatchAssociateScramSecret or Disassociate. It represents the
420
419
// secretArns that could not be associated and the reason
421
420
type unprocessedSecrets struct {
@@ -429,7 +428,7 @@ type unprocessedSecrets struct {
429
428
// errorMessages, and failedSecretArns
430
429
func (us unprocessedSecrets ) Error () string {
431
430
// I don't see a case where the lengths will differ
432
- // getting the minimum just in case, so we can avoid
431
+ // getting the minimum just in case, so we can avoid
433
432
// an index out of bounds
434
433
lenErrs := min (len (us .errorCodes ), len (us .errorMessages ), len (us .secretArns ))
435
434
errorMessage := ""
@@ -606,3 +605,11 @@ func customPreCompare(_ *ackcompare.Delta, a, b *resource) {
606
605
a .ko .Spec .StorageMode = aws .String (string (svcsdktypes .StorageModeLocal ))
607
606
}
608
607
}
608
+
609
+ func int32OrNil (num * int64 ) * int32 {
610
+ if num == nil {
611
+ return nil
612
+ }
613
+
614
+ return aws .Int32 (int32 (* num ))
615
+ }
0 commit comments