Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use stable instance-type label in inflight controllers #158

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

Noksa
Copy link
Contributor

@Noksa Noksa commented Jan 7, 2023

Fixes #157

Description
beta.kubernetes.io/instance-type label is deprecated.
node.kubernetes.io/instance-type should be used instead.

How was this change tested?
I've tested it using arm64 macbook

make toolchain
make test

Result:

❯ karpenter-core (issue-157-fix) ✔ make test                                  
go test ./... \
                -race \
                --ginkgo.focus="" \
                -cover -coverprofile=coverage.out -outputdir=. -coverpkg=./...
?       github.com/aws/karpenter-core/pkg/apis  [no test files]
?       github.com/aws/karpenter-core/pkg/apis/config   [no test files]
ok      github.com/aws/karpenter-core/pkg/apis/config/settings  1.037s  coverage: 1.6% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/apis/v1alpha5 2.752s  coverage: 4.0% of statements in ./...
?       github.com/aws/karpenter-core/pkg/cloudprovider [no test files]
?       github.com/aws/karpenter-core/pkg/cloudprovider/fake    [no test files]
?       github.com/aws/karpenter-core/pkg/cloudprovider/metrics [no test files]
?       github.com/aws/karpenter-core/pkg/controllers   [no test files]
?       github.com/aws/karpenter-core/pkg/controllers/counter   [no test files]
ok      github.com/aws/karpenter-core/pkg/controllers/deprovisioning    73.630s coverage: 46.4% of statements in ./...
?       github.com/aws/karpenter-core/pkg/controllers/deprovisioning/events     [no test files]
ok      github.com/aws/karpenter-core/pkg/controllers/inflightchecks    17.816s coverage: 9.6% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/metrics/pod       15.937s coverage: 4.1% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/metrics/provisioner       17.824s coverage: 5.2% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/metrics/state     18.290s coverage: 9.1% of statements in ./...
?       github.com/aws/karpenter-core/pkg/controllers/metrics/state/scraper     [no test files]
ok      github.com/aws/karpenter-core/pkg/controllers/node      18.524s coverage: 10.0% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/provisioning      22.317s coverage: 39.8% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling   71.539s coverage: 45.8% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/controllers/state     30.739s coverage: 14.1% of statements in ./...
?       github.com/aws/karpenter-core/pkg/controllers/state/informer    [no test files]
ok      github.com/aws/karpenter-core/pkg/controllers/termination       23.551s coverage: 7.9% of statements in ./...
ok      github.com/aws/karpenter-core/pkg/events        4.180s  coverage: 2.6% of statements in ./...
?       github.com/aws/karpenter-core/pkg/metrics       [no test files]
?       github.com/aws/karpenter-core/pkg/operator      [no test files]
ok      github.com/aws/karpenter-core/pkg/operator/controller   10.472s coverage: 6.5% of statements in ./...
?       github.com/aws/karpenter-core/pkg/operator/injection    [no test files]
?       github.com/aws/karpenter-core/pkg/operator/options      [no test files]
?       github.com/aws/karpenter-core/pkg/operator/scheme       [no test files]
ok      github.com/aws/karpenter-core/pkg/operator/settingsstore        7.963s  coverage: 3.2% of statements in ./...
?       github.com/aws/karpenter-core/pkg/operator/settingsstore/fake   [no test files]
ok      github.com/aws/karpenter-core/pkg/scheduling    1.379s  coverage: 5.3% of statements in ./...
?       github.com/aws/karpenter-core/pkg/test  [no test files]
?       github.com/aws/karpenter-core/pkg/test/expectations     [no test files]
ok      github.com/aws/karpenter-core/pkg/utils/atomic  1.490s  coverage: 1.8% of statements in ./...
?       github.com/aws/karpenter-core/pkg/utils/env     [no test files]
ok      github.com/aws/karpenter-core/pkg/utils/functional      0.766s  coverage: 1.2% of statements in ./...
?       github.com/aws/karpenter-core/pkg/utils/machine [no test files]
?       github.com/aws/karpenter-core/pkg/utils/node    [no test files]
?       github.com/aws/karpenter-core/pkg/utils/pod     [no test files]
?       github.com/aws/karpenter-core/pkg/utils/pretty  [no test files]
?       github.com/aws/karpenter-core/pkg/utils/resources       [no test files]
?       github.com/aws/karpenter-core/pkg/utils/result  [no test files]
?       github.com/aws/karpenter-core/pkg/utils/sets    [no test files]
?       github.com/aws/karpenter-core/pkg/webhooks      [no test files]                                                                                                                              1m:35s
❯ karpenter-core (issue-157-fix) ✔ 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…lers

Signed-off-by: alexandr.danilin <alexandr.danilin@ooma.com>
@Noksa Noksa requested a review from a team as a code owner January 7, 2023 19:06
@Noksa Noksa requested a review from engedaam January 7, 2023 19:06
Copy link
Contributor

@ellistarn ellistarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Noksa
Copy link
Contributor Author

Noksa commented Jan 8, 2023

I guess checks failed due to the fact that github-hosted runners have only 2 cpu (for x86_64).
Perhaps, this may be the cause why some tests are flaky from time to time in github-actions.
When I run tests locally, they consume 4-7 cores. Tried it on both linux x86-64 and mac arm64

@ellistarn
Copy link
Contributor

We have occasional flakes we try to track down, but I'll just restart the jobs so you don't get blocked on that.

@coveralls
Copy link

coveralls commented Jan 8, 2023

Pull Request Test Coverage Report for Build 3863506961

  • 2 of 4 (50.0%) changed or added relevant lines in 2 files are covered.
  • 19 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.03%) to 76.35%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/inflightchecks/failedinit.go 1 2 50.0%
pkg/controllers/inflightchecks/nodeshape.go 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
pkg/controllers/deprovisioning/controller.go 3 70.33%
pkg/controllers/node/controller.go 7 74.19%
pkg/controllers/deprovisioning/events/events.go 9 80.0%
Totals Coverage Status
Change from base Build 3857342106: -0.03%
Covered Lines: 5782
Relevant Lines: 7573

💛 - Coveralls

@jonathan-innis jonathan-innis merged commit 7939cc9 into kubernetes-sigs:main Jan 10, 2023
@Noksa Noksa deleted the issue-157-fix branch January 10, 2023 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inflight checks use beta instance-type label instead of stable
4 participants