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: correct error type for NodeClaim helpers #1739

Merged

Conversation

jmdeal
Copy link
Member

@jmdeal jmdeal commented Oct 5, 2024

Fixes #N/A

Description
This corrects the error type returned for the NodeClaimForNode utility function. Additionally, corrects some of the comments. The only reference to this utility function already correctly handled both error types so no update is needed there.

// If there's no associated node claim, it's not a karpenter owned node.
nc, err := nodeutils.NodeClaimForNode(ctx, c.kubeClient, node)
if err != nil {
// if the nodeclaim doesn't exist, or has duplicates, ignore.
return reconcile.Result{}, nodeutils.IgnoreDuplicateNodeClaimError(nodeutils.IgnoreNodeClaimNotFoundError(fmt.Errorf("getting nodeclaims for node, %w", err)))
}

How was this change tested?
make presubmit

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 Oct 5, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 5, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11188829925

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • 12 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 80.635%

Files with Coverage Reduction New Missed Lines %
pkg/scheduling/requirements.go 2 98.01%
pkg/controllers/provisioning/scheduling/nodeclaim.go 2 89.13%
pkg/utils/node/node.go 8 70.59%
Totals Coverage Status
Change from base Build 11169601877: 0.03%
Covered Lines: 8436
Relevant Lines: 10462

💛 - Coveralls

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2024
@jonathan-innis
Copy link
Member

/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 Oct 5, 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 7e01f70 into kubernetes-sigs:main Oct 5, 2024
12 checks passed
jeevanpuchakay pushed a commit to jeevanpuchakay/karpenter that referenced this pull request Oct 6, 2024
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants