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

Hegelc cleanup #76

Merged
merged 4 commits into from
Jan 12, 2022
Merged

Hegelc cleanup #76

merged 4 commits into from
Jan 12, 2022

Conversation

displague
Copy link
Member

@displague displague commented Jan 11, 2022

Description

  • Moves /hegelc to /cmd/hegelc
  • Adds environment variables (HEGEL_SERVER, HEGEL_PORT)
  • Adds flags (-server, -port)
  • changes default hostname to metadata from metadata.packet.net
  • default error behavior is Fatal (exit code 1) rather than Panic (exit code 2)
  • use grpc.DialContext instead of grpc.Dial
  • fixes gocritic warnings about exitAfterDefer

Why is this needed

Fixes: #67

How Has This Been Tested?

ran with -help, env variables set, flags set. Attempted invalid ports and hostnames and got appropriate errors.

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

The default server changes from metadata.packet.net to metadata.

Checklist:

I have:

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

@displague displague mentioned this pull request Jan 11, 2022
@displague displague added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. size/S estimate of the amount of work to address the issue labels Jan 11, 2022
@mmlb
Copy link
Contributor

mmlb commented Jan 11, 2022

Note that log.Panic panics and thus defered functions are run, but log.Fatal I think calls os.Exit and does not run defers. I think that's fine though and better for a cli than dumping a stack trace anyway.

cmd/hegelc/main.go Outdated Show resolved Hide resolved
cmd/hegelc/main.go Outdated Show resolved Hide resolved
Signed-off-by: Marques Johansson <[email protected]>
@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #76 (54c41c0) into main (41e18c1) will not change coverage.
The diff coverage is n/a.

❗ Current head 54c41c0 differs from pull request most recent head 8fe0aed. Consider uploading reports for the commit 8fe0aed to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main      #76   +/-   ##
=======================================
  Coverage   50.71%   50.71%           
=======================================
  Files           3        3           
  Lines         418      418           
=======================================
  Hits          212      212           
  Misses        175      175           
  Partials       31       31           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41e18c1...8fe0aed. Read the comment docs.

@displague displague requested a review from mmlb January 11, 2022 17:52
Copy link
Contributor

@mmlb mmlb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan of basically empty main, but oh well not really a big deal either

@displague displague merged commit 94487d4 into tinkerbell:main Jan 12, 2022
@displague displague deleted the hegelc-cleanup branch January 12, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. size/S estimate of the amount of work to address the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove or fix hegelc
2 participants