Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 7497fbc

Browse files
committed
Make use of type constants and compare type not name
1 parent 7854a6b commit 7497fbc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/tarmak/provider/amazon/amazon.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ func (a *Amazon) VerifyInstanceTypes(instancePools []interfaces.InstancePool) er
525525
result = multierror.Append(result, err)
526526
}
527527

528-
switch instance.Name() {
528+
switch instance.InstanceType() {
529529

530-
case "master":
530+
case clusterv1alpha1.InstancePoolTypeMaster:
531531
found := false
532532
for _, s := range a.nonMasterType() {
533533
if s == instanceType {
@@ -541,7 +541,7 @@ func (a *Amazon) VerifyInstanceTypes(instancePools []interfaces.InstancePool) er
541541
}
542542
break
543543

544-
case "etcd", "vault":
544+
case clusterv1alpha1.InstancePoolTypeEtcd, clusterv1alpha1.InstancePoolTypeVault:
545545
if a.awsInstanceBurstable(instanceType) {
546546
a.tarmak.Log().Warnf("Burstable type '%s' is not advised for instance '%s'", instanceType, instance.Name())
547547
}

0 commit comments

Comments
 (0)