Skip to content

Commit

Permalink
chore: Update liniting for release-v0.34.x (aws#6930)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Sep 5, 2024
1 parent f0ffe33 commit e35e48d
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 15 deletions.
10 changes: 5 additions & 5 deletions hack/docgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -euo pipefail
compatibilitymatrix() {
# versionCount is the number of K8s versions to display in the compatibility matrix
versionCount=7
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 $versionCount
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 $versionCount
}


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.
2 changes: 2 additions & 0 deletions pkg/apis/v1beta1/ec2nodeclass_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
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 @@ -216,6 +216,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 @@ -233,7 +233,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 @@ -506,7 +506,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 pkg/test/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type Environment struct {
SubnetCache *cache.Cache
SecurityGroupCache *cache.Cache
InstanceProfileCache *cache.Cache
SSMProviderCache *cache.Cache
SSMProviderCache *cache.Cache

// Providers
InstanceTypesProvider *instancetype.Provider
Expand Down Expand Up @@ -147,7 +147,7 @@ func NewEnvironment(ctx context.Context, env *coretest.Environment) *Environment
SecurityGroupCache: securityGroupCache,
InstanceProfileCache: instanceProfileCache,
UnavailableOfferingsCache: unavailableOfferingsCache,
SSMProviderCache: ssmProviderCache,
SSMProviderCache: ssmProviderCache,

InstanceTypesProvider: instanceTypesProvider,
InstanceProvider: instanceProvider,
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" %}}
The Ubuntu EKS optimized AMI has moved from 20.04 to 22.04 for Kubernetes 1.29+. This new AMI version is __not currently__ supported for users relying on AMI auto-discovery with the Ubuntu AMI family. More details can be found in this [GitHub issue](https://github.com/aws/karpenter-provider-aws/issues/5572). Please review this issue before upgrading to Kubernetes 1.29 if you are using the Ubuntu AMI family. Upgrading to 1.29 without making any changes to your EC2NodeClass will result in Karpenter being unable to create new nodes.
Expand Down

0 comments on commit e35e48d

Please sign in to comment.