Skip to content

Commit

Permalink
HELP-56667: Revert changes in PR #1967 for DiskIOPS for Kubernetes de…
Browse files Browse the repository at this point in the history
…ployment (#2812)
  • Loading branch information
igor-karpukhin committed Mar 28, 2024
1 parent 72dbfcb commit c79e7f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
23 changes: 23 additions & 0 deletions internal/kubernetes/operator/convert/convert.go
@@ -0,0 +1,23 @@
// Copyright 2024 MongoDB Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package convert

func IntToInt64(source *int) *int64 {
if source == nil {
return nil
}
x := int64(*source)
return &x
}
7 changes: 4 additions & 3 deletions internal/kubernetes/operator/deployment/deployment.go
Expand Up @@ -17,6 +17,7 @@ package deployment
import (
"fmt"

"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/convert"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/features"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/resources"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
Expand Down Expand Up @@ -389,7 +390,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan
var analyticsSpecs *akov2.Specs
if rc.AnalyticsSpecs != nil {
analyticsSpecs = &akov2.Specs{
DiskIOPS: pointer.Get(int64(rc.AnalyticsSpecs.GetDiskIOPS())),
DiskIOPS: convert.IntToInt64(rc.AnalyticsSpecs.DiskIOPS),
EbsVolumeType: rc.AnalyticsSpecs.GetEbsVolumeType(),
InstanceSize: rc.AnalyticsSpecs.GetInstanceSize(),
NodeCount: rc.AnalyticsSpecs.NodeCount,
Expand All @@ -398,7 +399,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan
var electableSpecs *akov2.Specs
if rc.ElectableSpecs != nil {
electableSpecs = &akov2.Specs{
DiskIOPS: pointer.Get(int64(rc.ElectableSpecs.GetDiskIOPS())),
DiskIOPS: convert.IntToInt64(rc.ElectableSpecs.DiskIOPS),
EbsVolumeType: rc.ElectableSpecs.GetEbsVolumeType(),
InstanceSize: rc.ElectableSpecs.GetInstanceSize(),
NodeCount: rc.ElectableSpecs.NodeCount,
Expand All @@ -408,7 +409,7 @@ func buildReplicationSpec(atlasRepSpec []atlasv2.ReplicationSpec) []*akov2.Advan
var readOnlySpecs *akov2.Specs
if rc.ReadOnlySpecs != nil {
readOnlySpecs = &akov2.Specs{
DiskIOPS: pointer.Get(int64(rc.ReadOnlySpecs.GetDiskIOPS())),
DiskIOPS: convert.IntToInt64(rc.ReadOnlySpecs.DiskIOPS),
EbsVolumeType: rc.ReadOnlySpecs.GetEbsVolumeType(),
InstanceSize: rc.ReadOnlySpecs.GetInstanceSize(),
NodeCount: rc.ReadOnlySpecs.NodeCount,
Expand Down

0 comments on commit c79e7f7

Please sign in to comment.