|
|
@@ -25,7 +25,7 @@ func Test_awsKey_getUsageType(t *testing.T) {
|
|
|
want: "",
|
|
|
},
|
|
|
{
|
|
|
- name: "label with a capacityType set to empty string should return empty string",
|
|
|
+ name: "EKS label with a capacityType set to empty string should return empty string",
|
|
|
args: args{
|
|
|
labels: map[string]string{
|
|
|
EKSCapacityTypeLabel: "",
|
|
|
@@ -34,7 +34,7 @@ func Test_awsKey_getUsageType(t *testing.T) {
|
|
|
want: "",
|
|
|
},
|
|
|
{
|
|
|
- name: "label with capacityType set to a random value should return empty string",
|
|
|
+ name: "EKS label with capacityType set to a random value should return empty string",
|
|
|
args: args{
|
|
|
labels: map[string]string{
|
|
|
EKSCapacityTypeLabel: "TEST_ME",
|
|
|
@@ -43,7 +43,7 @@ func Test_awsKey_getUsageType(t *testing.T) {
|
|
|
want: "",
|
|
|
},
|
|
|
{
|
|
|
- name: "label with capacityType set to spot should return spot",
|
|
|
+ name: "EKS label with capacityType set to spot should return spot",
|
|
|
args: args{
|
|
|
labels: map[string]string{
|
|
|
EKSCapacityTypeLabel: EKSCapacitySpotTypeValue,
|
|
|
@@ -51,6 +51,33 @@ func Test_awsKey_getUsageType(t *testing.T) {
|
|
|
},
|
|
|
want: PreemptibleType,
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "Karpenter label with a capacityType set to empty string should return empty string",
|
|
|
+ args: args{
|
|
|
+ labels: map[string]string{
|
|
|
+ KarpenterCapacityTypeLabel: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ want: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Karpenter label with capacityType set to a random value should return empty string",
|
|
|
+ args: args{
|
|
|
+ labels: map[string]string{
|
|
|
+ KarpenterCapacityTypeLabel: "TEST_ME",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ want: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Karpenter label with capacityType set to spot should return spot",
|
|
|
+ args: args{
|
|
|
+ labels: map[string]string{
|
|
|
+ KarpenterCapacityTypeLabel: KarpenterCapacitySpotTypeValue,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ want: PreemptibleType,
|
|
|
+ },
|
|
|
}
|
|
|
for _, tt := range tests {
|
|
|
t.Run(tt.name, func(t *testing.T) {
|