File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
internal/cli/atlas/clusters Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,11 @@ func (opts *UpgradeOpts) patchOpts(out *atlas.Cluster) {
95
95
if opts .diskSizeGB > 0 {
96
96
out .DiskSizeGB = & opts .diskSizeGB
97
97
}
98
- if opts .tier != "" && out .ProviderSettings != nil {
99
- out .ProviderSettings .InstanceSizeName = opts .tier
100
- if opts .tier == atlasM2 || opts .tier == atlasM5 {
98
+ if out .ProviderSettings != nil {
99
+ if opts .tier != "" {
100
+ out .ProviderSettings .InstanceSizeName = opts .tier
101
+ }
102
+ if isTenant (out .ProviderSettings .InstanceSizeName ) {
101
103
out .BiConnector = nil
102
104
} else {
103
105
out .ProviderSettings .ProviderName = out .ProviderSettings .BackingProviderName
@@ -121,6 +123,12 @@ func (opts *UpgradeOpts) patchOpts(out *atlas.Cluster) {
121
123
out .Tags = & tags
122
124
}
123
125
126
+ func isTenant (instanceSizeName string ) bool {
127
+ return instanceSizeName == atlasM0 ||
128
+ instanceSizeName == atlasM2 ||
129
+ instanceSizeName == atlasM5
130
+ }
131
+
124
132
// UpgradeBuilder atlas cluster(s) upgrade [clusterName] --projectId projectId [--tier M#] [--diskSizeGB N] [--mdbVersion] [--tag key=value].
125
133
func UpgradeBuilder () * cobra.Command {
126
134
opts := UpgradeOpts {
You can’t perform that action at this time.
0 commit comments