// PickInstanceType - Standard instance always wins!
// This function should not exist but it does represents some requirement
// from business to only pick one instance type when two are presented.
// When standard instance type is present in user instances it should always take precedence
Standard instance always wins.
This function should not exist but it does represents some requirement
from business to only pick one instance type when two are presented.
When standard instance type is present in user instances it should always take precedence
// PickInstanceType - Standard instance always wins! // This function should not exist but it does represents some requirement // from business to only pick one instance type when two are presented . // When standard instance type is present in user instances it should always take precedence
func PickInstanceType(amsTypes []QuotaSpec) *QuotaSpec {
	if amsTypes == nil || len(amsTypes) == 0 {
		return nil
	}
	for _, amsType := range amsTypes {
		if amsType.Name == QuotaStandardType {
			return &amsType
		}
	}
	return &amsTypes[0]
}
func PickInstanceType ( amsTypes [ ] QuotaSpec ) * QuotaSpec { if amsTypes == nil || len ( amsTypes ) == 0 { return nil } for _ , amsType := range amsTypes { if amsType . Name == QuotaStandardType { return & amsType } } return & amsTypes [ 0 ] }
Standard instance always wins.
Standard instance always wins .
// There is chance of having multiple instances in the future // We will pick the first one as we do not know which one to pick