fedora-iot / greenboot

Generic Health Checking Framework for systemd
GNU Lesser General Public License v2.1
101 stars 29 forks source link

greenboot: warn users of missing disabled healthchecks #141

Closed djach7 closed 6 months ago

djach7 commented 6 months ago

Resolves #139. Prints a warning in the logs when a user specifies a healthcheck to be disabled that cannot be found.

djach7 commented 6 months ago

I don't disagree that I might've overcomplicated it. I think I ended up with the map solution because I'm comfortable with them and I was trying to figure out how to avoid duplicating looping through the script directories (since it's already done with the script runner). (Frankly I thought it was just kind of a cool way to do it too.) I'm not at all against revising it, though, and if that's what the consensus is then I can work on that.

And thank you for the info about source_configuration_file, I'll make that change then.

runcom commented 6 months ago

I'm torn as I like both approaches :stuck_out_tongue_closed_eyes: the O(1) lookup is a cool thing to see even if we're not really expecting tons of elements and/or searches anyway. Miguel's approach is definitely more concise and to the point w/o a global call to populate the map. I guess I'm leaning towards what Miguel suggested but the idea of the map is certainly cool in general (where it probably makes more sense)

7flying commented 6 months ago

I like both approaches but I find using a map more elegant, and if we all agree that both things are OK I would lean towards what's already done to avoid pointless rewrites if there is no change in runtime performance.

runcom commented 6 months ago

certainly no performance hits given the amount of elements we're going to cycle on :+1: