Skip to content

Commit

Permalink
chore: Update liniting for release-v0.33.x (#6929)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Sep 5, 2024
1 parent b138dff commit e72e257
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 17 deletions.
10 changes: 5 additions & 5 deletions hack/docgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
set -euo pipefail

compatibilitymatrix() {
go run hack/docs/version_compatibility.go hack/docs/compatibility-karpenter.yaml "$(git describe --exact-match --tags || echo "no tag")"
go run hack/docs/compatibilitymetrix_gen_docs.go website/content/en/preview/upgrading/compatibility.md hack/docs/compatibility-karpenter.yaml 6
go run hack/docs/versioncompatibility/main.go hack/docs/compatibilitymatrix/compatibility-karpenter.yaml "$(git describe --exact-match --tags || echo "no tag")"
go run hack/docs/compatibilitymatrix/main.go website/content/en/preview/upgrading/compatibility.md hack/docs/compatibilitymatrix/compatibility-karpenter.yaml 6
}


compatibilitymatrix
go run hack/docs/metrics_gen_docs.go pkg/ ${KARPENTER_CORE_DIR}/pkg website/content/en/preview/reference/metrics.md
go run hack/docs/instancetypes_gen_docs.go website/content/en/preview/reference/instance-types.md
go run hack/docs/configuration_gen_docs.go website/content/en/preview/reference/settings.md
go run hack/docs/metrics/main.go pkg/ ${KARPENTER_CORE_DIR}/pkg website/content/en/preview/reference/metrics.md
go run hack/docs/instancetypes/main.go website/content/en/preview/reference/instance-types.md
go run hack/docs/configuration/main.go website/content/en/preview/reference/settings.md
cd charts/karpenter && helm-docs
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func main() {
os.Exit(1)
}

genStart := "[comment]: <> (the content below is generated from hack/docs/compataiblitymetrix_gen_docs.go)"
genEnd := "[comment]: <> (end docs generated content from hack/docs/compataiblitymetrix_gen_docs.go)"
genStart := "[comment]: <> (the content below is generated from hack/docs/compatibilitymatrix/main.go)"
genEnd := "[comment]: <> (end docs generated content from hack/docs/compatibilitymatrix/main.go)"
startDocSections := strings.Split(string(mdFile), genStart)
if len(startDocSections) != 2 {
log.Fatalf("expected one generated comment block start but got %d", len(startDocSections)-1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion pkg/apis/v1/ec2nodeclass_validation_cel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"time"

"github.com/aws/aws-sdk-go/aws"
v1 "github.com/aws/karpenter/pkg/apis/v1"
"github.com/imdario/mergo"
"github.com/samber/lo"
corev1 "k8s.io/api/core/v1"
Expand All @@ -30,6 +29,8 @@ import (
karpv1 "sigs.k8s.io/karpenter/pkg/apis/v1"
"sigs.k8s.io/karpenter/pkg/test"

v1 "github.com/aws/karpenter/pkg/apis/v1"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/v1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import (
"context"
"testing"

"github.com/aws/karpenter/pkg/apis"
"github.com/aws/karpenter/pkg/test"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "knative.dev/pkg/logging/testing"

"github.com/aws/karpenter/pkg/apis"
"github.com/aws/karpenter/pkg/test"

"sigs.k8s.io/karpenter/pkg/operator/scheme"
. "sigs.k8s.io/karpenter/pkg/test/expectations"

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/v1beta1/ec2nodeclass_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ import (

func (in *EC2NodeClass) ConvertTo(ctx context.Context, to apis.Convertible) error { return nil }

func (in *EC2NodeClass) ConvertFrom(ctx context.Context, from apis.Convertible) error { return nil }
func (in *EC2NodeClass) ConvertFrom(ctx context.Context, from apis.Convertible) error { return nil }
2 changes: 1 addition & 1 deletion pkg/providers/amifamily/ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func NewProvider(versionProvider *version.Provider, ssmProvider ssm.Provider, ec
cache: cache,
ec2api: ec2api,
cm: pretty.NewChangeMonitor(),
ssmProvider: ssmProvider,
ssmProvider: ssmProvider,
versionProvider: versionProvider,
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/providers/amifamily/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ func (r Resolver) resolveLaunchTemplate(nodeClass *v1beta1.EC2NodeClass, nodeCla
}
}
if kubeletConfig.MaxPods == nil {
// nolint:gosec
// We know that it's not possible to have values that would overflow int32 here since we control
// the maxPods values that we pass in here
kubeletConfig.MaxPods = lo.ToPtr(int32(maxPods))
}
resolved := &LaunchTemplate{
Expand Down
6 changes: 3 additions & 3 deletions pkg/providers/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package instance

import (
"context"
"errors"
stderrors "errors"
"fmt"
"math"
"sort"
Expand Down Expand Up @@ -229,7 +229,7 @@ func (p *Provider) launchInstance(ctx context.Context, nodeClass *v1beta1.EC2Nod
return nil, fmt.Errorf("creating fleet %w", err)
}
var reqFailure awserr.RequestFailure
if errors.As(err, &reqFailure) {
if stderrors.As(err, &reqFailure) {
return nil, fmt.Errorf("creating fleet %w (%s)", err, reqFailure.RequestID())
}
return nil, fmt.Errorf("creating fleet %w", err)
Expand Down Expand Up @@ -502,7 +502,7 @@ func combineFleetErrors(errors []*ec2.CreateFleetError) (errs error) {
unique.Insert(fmt.Sprintf("%s: %s", aws.StringValue(err.ErrorCode), aws.StringValue(err.ErrorMessage)))
}
for errorCode := range unique {
errs = multierr.Append(errs, fmt.Errorf(errorCode))
errs = multierr.Append(errs, stderrors.New(errorCode))
}
// If all the Fleet errors are ICE errors then we should wrap the combined error in the generic ICE error
iceErrorCount := lo.CountBy(errors, func(err *ec2.CreateFleetError) bool { return awserrors.IsUnfulfillableCapacity(err) })
Expand Down
4 changes: 2 additions & 2 deletions website/content/en/preview/upgrading/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Before you begin upgrading Karpenter, consider Karpenter compatibility issues re

## Compatibility Matrix

[comment]: <> (the content below is generated from hack/docs/compataiblitymetrix_gen_docs.go)
[comment]: <> (the content below is generated from hack/docs/compatibilitymatrix/main.go)

| KUBERNETES | 1.23 | 1.24 | 1.25 | 1.26 | 1.27 | 1.28 |
|------------|---------|---------|---------|---------|---------|---------|
| karpenter | 0.21.x+ | 0.21.x+ | 0.25.x+ | 0.28.x+ | 0.28.x+ | 0.31.x+ |

[comment]: <> (end docs generated content from hack/docs/compataiblitymetrix_gen_docs.go)
[comment]: <> (end docs generated content from hack/docs/compatibilitymatrix/main.go)

{{% alert title="Note" color="warning" %}}
Karpenter currently does not support the following [new `topologySpreadConstraints` keys](https://kubernetes.io/blog/2023/04/17/fine-grained-pod-topology-spread-features-beta/), promoted to beta in Kubernetes 1.27:
Expand Down

0 comments on commit e72e257

Please sign in to comment.