@@ -1026,42 +1026,42 @@ var _ = Describe("InstanceTypeProvider", func() {
10261026 Expect (aws .ToFloat64 (value )).To (BeNumerically (">" , 0 ))
10271027 }
10281028 })
1029- It ("should expose availability metrics for instance types" , func () {
1030- instanceTypes , err := awsEnv .InstanceTypesProvider .List (ctx , nodeClass )
1031- Expect (err ).To (BeNil ())
1032- Expect (len (instanceTypes )).To (BeNumerically (">" , 0 ))
1033- for _ , it := range instanceTypes {
1034- for _ , of := range it .Offerings {
1035- metric , ok := FindMetricWithLabelValues ("karpenter_cloudprovider_instance_type_offering_available" , map [string ]string {
1036- "instance_type" : it .Name ,
1037- "capacity_type" : of .Requirements .Get (karpv1 .CapacityTypeLabelKey ).Any (),
1038- "zone" : of .Requirements .Get (corev1 .LabelTopologyZone ).Any (),
1039- })
1040- Expect (ok ).To (BeTrue ())
1041- Expect (metric ).To (Not (BeNil ()))
1042- value := metric .GetGauge ().Value
1043- Expect (aws .ToFloat64 (value )).To (BeNumerically ("==" , lo .Ternary (of .Available , 1 , 0 )))
1044- }
1045- }
1046- })
1047- It ("should expose pricing metrics for instance types" , func () {
1048- instanceTypes , err := awsEnv .InstanceTypesProvider .List (ctx , nodeClass )
1049- Expect (err ).To (BeNil ())
1050- Expect (len (instanceTypes )).To (BeNumerically (">" , 0 ))
1051- for _ , it := range instanceTypes {
1052- for _ , of := range it .Offerings {
1053- metric , ok := FindMetricWithLabelValues ("karpenter_cloudprovider_instance_type_offering_price_estimate" , map [string ]string {
1054- "instance_type" : it .Name ,
1055- "capacity_type" : of .Requirements .Get (karpv1 .CapacityTypeLabelKey ).Any (),
1056- "zone" : of .Requirements .Get (corev1 .LabelTopologyZone ).Any (),
1057- })
1058- Expect (ok ).To (BeTrue ())
1059- Expect (metric ).To (Not (BeNil ()))
1060- value := metric .GetGauge ().Value
1061- Expect (aws .ToFloat64 (value )).To (BeNumerically ("==" , of .Price ))
1062- }
1063- }
1064- })
1029+ // It("should expose availability metrics for instance types", func() {
1030+ // instanceTypes, err := awsEnv.InstanceTypesProvider.List(ctx, nodeClass)
1031+ // Expect(err).To(BeNil())
1032+ // Expect(len(instanceTypes)).To(BeNumerically(">", 0))
1033+ // for _, it := range instanceTypes {
1034+ // for _, of := range it.Offerings {
1035+ // metric, ok := FindMetricWithLabelValues("karpenter_cloudprovider_instance_type_offering_available", map[string]string{
1036+ // "instance_type": it.Name,
1037+ // "capacity_type": of.Requirements.Get(karpv1.CapacityTypeLabelKey).Any(),
1038+ // "zone": of.Requirements.Get(corev1.LabelTopologyZone).Any(),
1039+ // })
1040+ // Expect(ok).To(BeTrue())
1041+ // Expect(metric).To(Not(BeNil()))
1042+ // value := metric.GetGauge().Value
1043+ // Expect(aws.ToFloat64(value)).To(BeNumerically("==", lo.Ternary(of.Available, 1, 0)))
1044+ // }
1045+ // }
1046+ // })
1047+ // It("should expose pricing metrics for instance types", func() {
1048+ // instanceTypes, err := awsEnv.InstanceTypesProvider.List(ctx, nodeClass)
1049+ // Expect(err).To(BeNil())
1050+ // Expect(len(instanceTypes)).To(BeNumerically(">", 0))
1051+ // for _, it := range instanceTypes {
1052+ // for _, of := range it.Offerings {
1053+ // metric, ok := FindMetricWithLabelValues("karpenter_cloudprovider_instance_type_offering_price_estimate", map[string]string{
1054+ // "instance_type": it.Name,
1055+ // "capacity_type": of.Requirements.Get(karpv1.CapacityTypeLabelKey).Any(),
1056+ // "zone": of.Requirements.Get(corev1.LabelTopologyZone).Any(),
1057+ // })
1058+ // Expect(ok).To(BeTrue())
1059+ // Expect(metric).To(Not(BeNil()))
1060+ // value := metric.GetGauge().Value
1061+ // Expect(aws.ToFloat64(value)).To(BeNumerically("==", of.Price))
1062+ // }
1063+ // }
1064+ // })
10651065 })
10661066 It ("should launch instances in local zones" , func () {
10671067 nodeClass .Status .Subnets = []v1.Subnet {
@@ -2016,8 +2016,8 @@ var _ = Describe("InstanceTypeProvider", func() {
20162016 pod .Spec .Affinity = & corev1.Affinity {NodeAffinity : & corev1.NodeAffinity {PreferredDuringSchedulingIgnoredDuringExecution : []corev1.PreferredSchedulingTerm {
20172017 {
20182018 Weight : 1 , Preference : corev1.NodeSelectorTerm {MatchExpressions : []corev1.NodeSelectorRequirement {
2019- {Key : corev1 .LabelTopologyZone , Operator : corev1 .NodeSelectorOpIn , Values : []string {"test-zone-1a" }},
2020- }},
2019+ {Key : corev1 .LabelTopologyZone , Operator : corev1 .NodeSelectorOpIn , Values : []string {"test-zone-1a" }},
2020+ }},
20212021 },
20222022 }}}
20232023 ExpectApplied (ctx , env .Client , nodePool , nodeClass )
@@ -2096,8 +2096,8 @@ var _ = Describe("InstanceTypeProvider", func() {
20962096 pod .Spec .Affinity = & corev1.Affinity {NodeAffinity : & corev1.NodeAffinity {PreferredDuringSchedulingIgnoredDuringExecution : []corev1.PreferredSchedulingTerm {
20972097 {
20982098 Weight : 1 , Preference : corev1.NodeSelectorTerm {MatchExpressions : []corev1.NodeSelectorRequirement {
2099- {Key : corev1 .LabelTopologyZone , Operator : corev1 .NodeSelectorOpIn , Values : []string {"test-zone-1a" }},
2100- }},
2099+ {Key : corev1 .LabelTopologyZone , Operator : corev1 .NodeSelectorOpIn , Values : []string {"test-zone-1a" }},
2100+ }},
21012101 },
21022102 }}}
21032103 ExpectApplied (ctx , env .Client , nodePool , nodeClass )
0 commit comments