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

feat: only operate on cloudprovider managed resources #1818

Merged

Conversation

jmdeal
Copy link
Member

@jmdeal jmdeal commented Nov 16, 2024

Fixes #N/A

Description
Karpenter should only operate on resources which are managed by the cloudprovider consuming this library. The CloudProvider provides a list of supported NodeClasses, Karpenter will assume ownership of any resource with a ref on one of those NodeClasses.

How was this change tested?
make test

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 16, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2024
@jmdeal jmdeal changed the title feat: only operate on cloudprovider managed resources [WIP] feat: only operate on cloudprovider managed resources Nov 16, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 16, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 3b2a62b to 4071259 Compare November 17, 2024 01:05
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 18, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 88e8d86 to 37312c6 Compare November 19, 2024 19:03
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 19, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch 3 times, most recently from f298996 to 9b62022 Compare November 20, 2024 20:59
@jmdeal jmdeal changed the title [WIP] feat: only operate on cloudprovider managed resources feat: only operate on cloudprovider managed resources Nov 20, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 20, 2024
@coveralls
Copy link

coveralls commented Nov 21, 2024

Pull Request Test Coverage Report for Build 11993136153

Details

  • 240 of 386 (62.18%) changed or added relevant lines in 36 files are covered.
  • 7 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.04%) to 81.017%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/metrics/nodepool/controller.go 7 8 87.5%
pkg/controllers/node/termination/controller.go 5 6 83.33%
pkg/controllers/nodeclaim/expiration/controller.go 7 8 87.5%
pkg/controllers/nodeclaim/lifecycle/registration.go 3 4 75.0%
pkg/controllers/nodepool/hash/controller.go 11 12 91.67%
pkg/controllers/nodepool/validation/controller.go 6 7 85.71%
pkg/controllers/state/informer/nodepool.go 7 8 87.5%
pkg/controllers/nodeclaim/lifecycle/controller.go 6 8 75.0%
pkg/controllers/nodeclaim/podevents/controller.go 5 7 71.43%
pkg/controllers/provisioning/provisioner.go 20 22 90.91%
Files with Coverage Reduction New Missed Lines %
pkg/utils/node/node.go 1 70.21%
pkg/utils/nodeclaim/nodeclaim.go 2 42.14%
pkg/controllers/nodepool/counter/controller.go 4 69.23%
Totals Coverage Status
Change from base Build 11964513047: -0.04%
Covered Lines: 8839
Relevant Lines: 10910

💛 - Coveralls

@jmdeal
Copy link
Member Author

jmdeal commented Nov 22, 2024

Holding while I do testing with the AWS provider

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 56fe4e4 to 8d10726 Compare November 22, 2024 05:33
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 8d10726 to ad7c521 Compare November 22, 2024 23:58
pkg/utils/nodeclaim/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/nodeclaim/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/nodeclaim/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/nodeclaim/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/nodeclaim/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/nodepool/nodepool.go Outdated Show resolved Hide resolved
pkg/utils/nodeclaim/suite_test.go Show resolved Hide resolved
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch 2 times, most recently from db1400e to 540eb38 Compare November 23, 2024 23:39
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 540eb38 to 007859a Compare November 24, 2024 00:00
pkg/test/nodeclaim.go Outdated Show resolved Hide resolved
pkg/utils/node/node.go Show resolved Hide resolved
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 2fd15d6 to 576093d Compare November 24, 2024 02:42
Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 24, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 576093d to 876eae4 Compare November 24, 2024 02:58
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2024
@jmdeal
Copy link
Member Author

jmdeal commented Nov 24, 2024

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 24, 2024
@jmdeal jmdeal force-pushed the fix/only-manage-owned-resources branch from 876eae4 to 0c8e235 Compare November 24, 2024 04:27
Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmdeal, jonathan-innis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 330b98b into kubernetes-sigs:main Nov 24, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants