tinkerbell / hegel

Instance Metadata Service
https://tinkerbell.org
Apache License 2.0
100 stars 33 forks source link

Handle Nil pointer error and update linter #389

Closed jacobweinstock closed 5 days ago

jacobweinstock commented 5 days ago

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:

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.