From 8725cbb6c2e18366b74a70ad59896c48fa9f7d82 Mon Sep 17 00:00:00 2001 From: elijah quinones Date: Wed, 14 Aug 2024 20:35:22 +0000 Subject: [PATCH] Refactor comments in volume_limits.go and test names in node_test.go --- pkg/cloud/volume_limits.go | 26 +++++++++++++------------- pkg/driver/node_test.go | 10 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/cloud/volume_limits.go b/pkg/cloud/volume_limits.go index 78adde15f..3488e7473 100644 --- a/pkg/cloud/volume_limits.go +++ b/pkg/cloud/volume_limits.go @@ -19,7 +19,7 @@ import ( "strings" ) -// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances +// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances const ( highMemoryMetalInstancesMaxVolumes = 19 highMemoryVirtualInstancesMaxVolumes = 27 @@ -51,7 +51,7 @@ func init() { var dedicatedVolumeLimits = map[string]int{} -// / List of nitro instance types can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances +// List of nitro instance types can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances var nonNitroInstanceFamilies = map[string]struct{}{ "t2": {}, "c3": {}, @@ -89,8 +89,8 @@ func GetMaxAttachments(nitro bool) int { return nonNitroMaxAttachments } -// / Some instance types have a maximum limit of EBS volumes -// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html +// Some instance types have a maximum limit of EBS volumes +// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html var maxVolumeLimits = map[string]int{ "d3.8xlarge": 3, "d3en.12xlarge": 3, @@ -157,9 +157,9 @@ func GetReservedSlotsForInstanceType(it string) int { return total } -// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-volumes.html -// / IMDS does not provide NVMe instance store data; we'll just list all instances here -// / g5.48xlarge is not added to this table as it is in the maxVolumeLimits +// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-volumes.html +// IMDS does not provide NVMe instance store data; we'll just list all instances here +// g5.48xlarge is not added to this table as it is in the maxVolumeLimits var nvmeInstanceStoreVolumes = map[string]int{ "c1.medium": 1, "c1.xlarge": 4, @@ -501,9 +501,9 @@ var nvmeInstanceStoreVolumes = map[string]int{ "z1d.xlarge": 1, } -// / https://aws.amazon.com/ec2/instance-types -// / Despite the dl1.24xlarge having Gaudi Accelerators describe instance types considers them GPUs as such that instacne type is in this table -// / g5.48xlarge is not added to this table as it is in the maxVolumeLimits +// https://aws.amazon.com/ec2/instance-types +// Despite the dl1.24xlarge having Gaudi Accelerators describe instance types considers them GPUs as such that instacne type is in this table +// g5.48xlarge is not added to this table as it is in the maxVolumeLimits var gpuInstanceGpus = map[string]int{ "dl1.24xlarge": 8, "g3.16xlarge": 4, @@ -557,9 +557,9 @@ var gpuInstanceGpus = map[string]int{ "p5.48xlarge": 8, } -// / Note this table is not a reflection of how many accelerators an instance has but of how many slots their combined acclerators take up -// / VT instance type accelerators take two slots each with the exception of the vt1.24xlarge which takes 0 slots for its acclerators -// / inf1 instance types are purposely not added to this table as they are in the maxVolumeLimits table +// Note this table is not a reflection of how many accelerators an instance has but of how many slots their combined acclerators take up +// VT instance type accelerators take two slots each with the exception of the vt1.24xlarge which takes 0 slots for its acclerators +// inf1 instance types are purposely not added to this table as they are in the maxVolumeLimits table var acceleratorSlotsTaken = map[string]int{ "vt1.3xlarge": 2, "vt1.6xlarge": 4, diff --git a/pkg/driver/node_test.go b/pkg/driver/node_test.go index 11bf21b84..26e171c43 100644 --- a/pkg/driver/node_test.go +++ b/pkg/driver/node_test.go @@ -1233,7 +1233,7 @@ func TestGetVolumesLimit(t *testing.T) { }, { // will and should fail if g5.48xlarge instance type is in any table other than maxVolumeLimits table - name: "g5.48xlarge_volume_attach_limit(has gpu and NVMe instance store volume but should be ignored for limits)", + name: "g5.48xlarge_volume_attach_limit (Instance has attached GPUs and NVMe Instance Store volumes but should be ignored for EBS volume limits calculation)", options: &Options{ VolumeAttachLimit: -1, ReservedVolumeAttachments: -1, @@ -1250,7 +1250,7 @@ func TestGetVolumesLimit(t *testing.T) { }, { // will and should fail if inf1.xlarge instance type is in any table other than maxVolumeLimits table - name: "inf1.xlarge_volume_attach_limit(has accerators but should be ignored for limits)", + name: "inf1.xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)", options: &Options{ VolumeAttachLimit: -1, ReservedVolumeAttachments: -1, @@ -1267,7 +1267,7 @@ func TestGetVolumesLimit(t *testing.T) { }, { // will and should fail if inf1.xlarge instance type is in any table other than maxVolumeLimits table - name: "inf1.2xlarge_volume_attach_limit(has accerators but should be ignored for limits)", + name: "inf1.2xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)", options: &Options{ VolumeAttachLimit: -1, ReservedVolumeAttachments: -1, @@ -1284,7 +1284,7 @@ func TestGetVolumesLimit(t *testing.T) { }, { // will and should fail if inf1.6xlarge instance type is in any table other than maxVolumeLimits table - name: "inf1.6xlarge_volume_attach_limit(has accerators but should be ignored for limits)", + name: "inf1.6xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)", options: &Options{ VolumeAttachLimit: -1, ReservedVolumeAttachments: -1, @@ -1301,7 +1301,7 @@ func TestGetVolumesLimit(t *testing.T) { }, { // will and should fail if inf1.24xlarge instance type is in any table other than maxVolumeLimits table - name: "inf1.24xlarge_volume_attach_limit(has accerators but should be ignored for limits)", + name: "inf1.24xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)", options: &Options{ VolumeAttachLimit: -1, ReservedVolumeAttachments: -1,