github.com/kubernetes-incubator/kube-aws@v0.16.4/pkg/api/ec2_instance.go (about) 1 package api 2 3 import "strings" 4 5 type EC2Instance struct { 6 Count int `yaml:"count,omitempty"` 7 CreateTimeout string `yaml:"createTimeout,omitempty"` 8 InstanceType string `yaml:"instanceType,omitempty"` 9 RootVolume `yaml:"rootVolume,omitempty"` 10 Tenancy string `yaml:"tenancy,omitempty"` 11 InstanceTags map[string]string `yaml:"instanceTags,omitempty"` 12 } 13 14 var nvmeEC2InstanceFamily = []string{"c5", "m5"} 15 16 func isNvmeEC2InstanceType(instanceType string) bool { 17 for _, family := range nvmeEC2InstanceFamily { 18 if strings.HasPrefix(instanceType, family) { 19 return true 20 } 21 } 22 return false 23 } 24 25 // This function is used when rendering cloud-config-worker 26 func (e EC2Instance) HasNvmeDevices() bool { 27 return isNvmeEC2InstanceType(e.InstanceType) 28 }