From 77be0190760ebac78c8bbbe0809a232fb42f29d8 Mon Sep 17 00:00:00 2001 From: Jason Deal Date: Fri, 1 Dec 2023 12:20:54 -0800 Subject: [PATCH] chore: release v0.31.3 (#5206) Co-authored-by: Brandon Wagner --- .golangci.yaml | 8 ++++++++ go.mod | 2 +- go.sum | 4 ++-- pkg/providers/instance/instance.go | 3 ++- pkg/providers/instancetype/instancetype.go | 3 +++ pkg/providers/instancetype/nodeclass_test.go | 2 +- pkg/providers/instancetype/nodetemplate_test.go | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 3fc54e3d71a4..8a19aae9fc5d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -37,6 +37,14 @@ linters-settings: min-complexity: 11 govet: check-shadowing: true + revive: + rules: + - name: dot-imports + disabled: true + stylecheck: + dot-import-whitelist: + - "github.com/onsi/ginkgo/v2" + - "github.com/onsi/gomega" misspell: locale: US ignore-words: [] diff --git a/go.mod b/go.mod index 553e58e1b5f1..7aa0838ef151 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/avast/retry-go v3.0.0+incompatible github.com/aws/aws-sdk-go v1.45.15 - github.com/aws/karpenter-core v0.31.2 + github.com/aws/karpenter-core v0.31.3 github.com/aws/karpenter/tools/kompat v0.0.0-20230915222222-abfbf5fa3644 github.com/imdario/mergo v0.3.16 github.com/mitchellh/hashstructure/v2 v2.0.2 diff --git a/go.sum b/go.sum index 37e25c708254..9ef493524277 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,8 @@ github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHS github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-sdk-go v1.45.15 h1:gYBTVSYuhXdatrLbsPaRgVcc637zzdgThWmsDRwXLOo= github.com/aws/aws-sdk-go v1.45.15/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/karpenter-core v0.31.2 h1:amhUzexn2drKXNOgjJR8TKFFcQRgXDRmp0CBVaOI39k= -github.com/aws/karpenter-core v0.31.2/go.mod h1:z5aEstzzERZMO2L0AkhxtBtaSI6yZ806XC9WSPgrHyM= +github.com/aws/karpenter-core v0.31.3 h1:sL2rYBEXZAJMityDltfXLOGRwR7R9Vj95iZhHlwUiNo= +github.com/aws/karpenter-core v0.31.3/go.mod h1:z5aEstzzERZMO2L0AkhxtBtaSI6yZ806XC9WSPgrHyM= github.com/aws/karpenter/tools/kompat v0.0.0-20230915222222-abfbf5fa3644 h1:M1fxGlOfvSqFYI01HL2zzvomy8e7LiTHk77KDuChWZQ= github.com/aws/karpenter/tools/kompat v0.0.0-20230915222222-abfbf5fa3644/go.mod h1:l/TIBsaCx/IrOr0Xvlj/cHLOf05QzuQKEZ1hx2XWmfU= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index 9b683849c285..6b86cfa060c9 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -20,6 +20,7 @@ import ( "fmt" "math" "sort" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -485,7 +486,7 @@ func filterExoticInstanceTypes(instanceTypes []*cloudprovider.InstanceType, isMa for _, it := range instanceTypes { // deprioritize metal even if our opinionated filter isn't applied due to something like an instance family // requirement - if it.Requirements.Get(lo.Ternary(isMachine, v1alpha1.LabelInstanceSize, v1beta1.LabelInstanceSize)).Has("metal") { + if _, ok := lo.Find(it.Requirements.Get(lo.Ternary(isMachine, v1alpha1.LabelInstanceSize, v1beta1.LabelInstanceSize)).Values(), func(size string) bool { return strings.Contains(size, "metal") }); ok { continue } if !resources.IsZero(it.Capacity[lo.Ternary(isMachine, v1alpha1.ResourceAWSNeuron, v1beta1.ResourceAWSNeuron)]) || diff --git a/pkg/providers/instancetype/instancetype.go b/pkg/providers/instancetype/instancetype.go index 4e780e41fbf4..c67436000cf7 100644 --- a/pkg/providers/instancetype/instancetype.go +++ b/pkg/providers/instancetype/instancetype.go @@ -141,6 +141,9 @@ func (p *Provider) createOfferings(ctx context.Context, instanceType *ec2.Instan price, ok = p.pricingProvider.SpotPrice(*instanceType.InstanceType, zone) case ec2.UsageClassTypeOnDemand: price, ok = p.pricingProvider.OnDemandPrice(*instanceType.InstanceType) + case "capacity-block": + // ignore since karpenter doesn't support it yet, but do not log an unknown capacity type error + continue default: logging.FromContext(ctx).Errorf("Received unknown capacity type %s for instance type %s", capacityType, *instanceType.InstanceType) continue diff --git a/pkg/providers/instancetype/nodeclass_test.go b/pkg/providers/instancetype/nodeclass_test.go index 454604a34d53..b2e3ba306887 100644 --- a/pkg/providers/instancetype/nodeclass_test.go +++ b/pkg/providers/instancetype/nodeclass_test.go @@ -385,7 +385,7 @@ var _ = Describe("NodeClass/InstanceTypes", func() { call := awsEnv.EC2API.CreateFleetBehavior.CalledWithInput.Pop() for _, ltc := range call.LaunchTemplateConfigs { for _, ovr := range ltc.Overrides { - Expect(strings.HasSuffix(aws.StringValue(ovr.InstanceType), "metal")).To(BeFalse()) + Expect(strings.Contains(aws.StringValue(ovr.InstanceType), "metal")).To(BeFalse()) } } }) diff --git a/pkg/providers/instancetype/nodetemplate_test.go b/pkg/providers/instancetype/nodetemplate_test.go index b7cab2ed9c73..afc8486259fe 100644 --- a/pkg/providers/instancetype/nodetemplate_test.go +++ b/pkg/providers/instancetype/nodetemplate_test.go @@ -392,7 +392,7 @@ var _ = Describe("NodeTemplate/InstanceTypes", func() { call := awsEnv.EC2API.CreateFleetBehavior.CalledWithInput.Pop() for _, ltc := range call.LaunchTemplateConfigs { for _, ovr := range ltc.Overrides { - Expect(strings.HasSuffix(aws.StringValue(ovr.InstanceType), "metal")).To(BeFalse()) + Expect(strings.Contains(aws.StringValue(ovr.InstanceType), "metal")).To(BeFalse()) } } })