Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-karpukhin committed Mar 26, 2024
1 parent 90d756a commit 90be3e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/kubernetes/operator/deployment/deployment.go
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions internal/pointer/pointer.go
Expand Up @@ -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
}

0 comments on commit 90be3e0

Please sign in to comment.