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

Commit

Permalink
Make use of type constants and compare type not name
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshVanL committed Jun 21, 2018
1 parent b8ae323 commit c3c73de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/tarmak/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ type InstancePool interface {
Validate() error
MinCount() int
MaxCount() int
InstanceType() string
}

type Volume interface {
Expand Down
6 changes: 3 additions & 3 deletions pkg/tarmak/provider/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,9 @@ func (a *Amazon) VerifyInstanceTypes(instancePools []interfaces.InstancePool) er
result = multierror.Append(result, err)
}

switch instance.Name() {
switch instance.InstanceType() {

case "master":
case clusterv1alpha1.InstancePoolTypeMaster:
found := false
for _, s := range a.nonMasterType() {
if s == instanceType {
Expand All @@ -539,7 +539,7 @@ func (a *Amazon) VerifyInstanceTypes(instancePools []interfaces.InstancePool) er
}
break

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

0 comments on commit c3c73de

Please sign in to comment.