diff --git a/internal/kubernetes/operator/deployment/deployment.go b/internal/kubernetes/operator/deployment/deployment.go index efcfd849d2..59d67ecb51 100644 --- a/internal/kubernetes/operator/deployment/deployment.go +++ b/internal/kubernetes/operator/deployment/deployment.go @@ -389,7 +389,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan var analyticsSpecs *akov2.Specs if rc.AnalyticsSpecs != nil { analyticsSpecs = &akov2.Specs{ - DiskIOPS: rc.AnalyticsSpecs.DiskIOPS, + DiskIOPS: pointer.IntToInt64(rc.AnalyticsSpecs.DiskIOPS), EbsVolumeType: rc.AnalyticsSpecs.GetEbsVolumeType(), InstanceSize: rc.AnalyticsSpecs.GetInstanceSize(), NodeCount: rc.AnalyticsSpecs.NodeCount, @@ -398,7 +398,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan var electableSpecs *akov2.Specs if rc.ElectableSpecs != nil { electableSpecs = &akov2.Specs{ - DiskIOPS: rc.ElectableSpecs.DiskIOPS, + DiskIOPS: pointer.IntToInt64(rc.ElectableSpecs.DiskIOPS), EbsVolumeType: rc.ElectableSpecs.GetEbsVolumeType(), InstanceSize: rc.ElectableSpecs.GetInstanceSize(), NodeCount: rc.ElectableSpecs.NodeCount, @@ -408,7 +408,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan var readOnlySpecs *akov2.Specs if rc.ReadOnlySpecs != nil { readOnlySpecs = &akov2.Specs{ - DiskIOPS: rc.ReadOnlySpecs.DiskIOPS, + DiskIOPS: pointer.IntToInt64(rc.ReadOnlySpecs.DiskIOPS), EbsVolumeType: rc.ReadOnlySpecs.GetEbsVolumeType(), InstanceSize: rc.ReadOnlySpecs.GetInstanceSize(), NodeCount: rc.ReadOnlySpecs.NodeCount, diff --git a/internal/pointer/pointer.go b/internal/pointer/pointer.go index 78599d8e98..227b2704bc 100644 --- a/internal/pointer/pointer.go +++ b/internal/pointer/pointer.go @@ -44,3 +44,11 @@ func GetNonZeroValue[T constraints.Integer](val T) *T { return nil } + +func IntToInt64(source *int) *int64 { + if source == nil { + return nil + } + x := int64(*source) + return &x +}