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: Panic on nodeClassRef nil dereference #1669

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

engedaam
Copy link
Contributor

@engedaam engedaam commented Sep 16, 2024

Fixes aws/karpenter-provider-aws#6867

Description

  • As part of server side apply, we saw that the API Server will send particle objects to be converted by the conversion webhooks. The API server will send a particle objects of fields that are owned by the field manger in applying a patch https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management. This can cause out conversion webhooks trying to deference a nil point on the nodeClassRef.

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
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 16, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 16, 2024
@engedaam engedaam changed the title fix: Add nil check for nodeclassref fix: Painc on nodeClassRef nil dereference Sep 16, 2024
@engedaam engedaam marked this pull request as ready for review September 16, 2024 20:11
@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 Sep 16, 2024
@jonathan-innis jonathan-innis changed the title fix: Painc on nodeClassRef nil dereference fix: Panic on nodeClassRef nil dereference Sep 18, 2024
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.

Are we going to add testing for this case?

pkg/apis/v1/nodeclaim_conversion.go Outdated Show resolved Hide resolved
pkg/apis/v1/nodepool_conversion.go Outdated Show resolved Hide resolved
@engedaam
Copy link
Contributor Author

I am planning on testing the panic of SSA as part E2E testing. But for now I added tests that validate the nil check until then.

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 Sep 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: engedaam, 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

@anzinchenko89
Copy link

@engedaam, could you please clarify when this fix is supposed to be released and which patch version v1.0.x is going to contain it? Thanks

@engedaam
Copy link
Contributor Author

engedaam commented Sep 25, 2024

We don't have a release date, but should be soon. It will be included in the next patch release for v1.0.3

@archana-punia
Copy link

Hi, Is this released in 1.0.4?

@jmdeal
Copy link
Member

jmdeal commented Oct 1, 2024

Yes, it's included in the 1.0.4 release for the AWS provider (1.0.2 in this repo).

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants