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

Handle Nil pointer error and update linter #389

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

jacobweinstock
Copy link
Member

Description

Handle Nil pointer error and update linter. As the Hardware spec.metadata and spec.metadata.instance are not required in the hardware object they could be nil. Handle checking this so we don't nil pointer panic.

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

As the Hardware spec.metadata and spec.metadata.instance
are not required in the hardware object they could be
nil. Handle checking this so we don't nil pointer panic.

Signed-off-by: Jacob Weinstock <[email protected]>
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.52%. Comparing base (871cca5) to head (a3b3716).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #389   +/-   ##
=======================================
  Coverage   55.52%   55.52%           
=======================================
  Files          27       27           
  Lines         787      787           
=======================================
  Hits          437      437           
  Misses        334      334           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jacobweinstock jacobweinstock merged commit a46edb5 into tinkerbell:main Nov 8, 2024
11 checks passed
@jacobweinstock jacobweinstock deleted the nil-pointer branch November 8, 2024 18:11
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.

1 participant