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

Major refactor of the tool #27

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Major refactor of the tool #27

merged 1 commit into from
Feb 11, 2025

Conversation

jonkerj
Copy link
Collaborator

@jonkerj jonkerj commented Feb 6, 2025

Goals:

  • increase modularity
  • importable functionality (e.g. nanotoolbox, vixserver) split into pkg/ packages
  • consistent, modular logging based on log/slog
  • cobra/viper (subcommands, flags/env var mixing)

This should also lay the groundwork for the implementation of #25

@jonkerj jonkerj force-pushed the refactor branch 6 times, most recently from 4151bde to 85b811a Compare February 10, 2025 11:33
@jonkerj jonkerj changed the title WIP: Major refactor of the tool Major refactor of the tool Feb 10, 2025
@jonkerj
Copy link
Collaborator Author

jonkerj commented Feb 10, 2025

Refactoring is done, shutdown/reboot from vSphere seems to work and vSphere shows correct hostname and IP-info. I think refactoring is done and it's time for a review/merge/release.

@jonkerj jonkerj force-pushed the refactor branch 2 times, most recently from 4163bd2 to b80971b Compare February 10, 2025 12:12
@jonkerj jonkerj requested a review from robinelfrink February 10, 2025 12:15
@jonkerj jonkerj self-assigned this Feb 10, 2025
@jonkerj jonkerj force-pushed the refactor branch 8 times, most recently from 2409e1f to 7855aa6 Compare February 11, 2025 09:15
@jonkerj
Copy link
Collaborator Author

jonkerj commented Feb 11, 2025

All the testing is complete, even the linters are happy now. We have tested the tool in the following ways:

  • as a standalone binary, pointing to a remote apid with subcommand talosquery
  • as a Pod, pointing to local apid, with subcommands vmtoolsd and talosquery. The former yielded proper information (DNS name, IP addresses) in vSphere UI
  • as a system extention, using local machined unix socket connection

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

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

thank you, I will approve this PR so that you're not blocked, feel free to /m it whenever you're ready.

if you need other reviewers with actual VMWare knowledge, please ping them :)

@robinelfrink
Copy link
Collaborator

if you need other reviewers with actual VMWare knowledge, please ping them :)

I'm about to double check functionality of the tool as system-extension and as a daemonset.

@jonkerj jonkerj force-pushed the refactor branch 2 times, most recently from 54b3783 to 871c8e5 Compare February 11, 2025 10:09
@jonkerj
Copy link
Collaborator Author

jonkerj commented Feb 11, 2025

We are going to release this as a new major version, as flags/env vars have been renamed.

Copy link
Collaborator

@robinelfrink robinelfrink left a comment

Choose a reason for hiding this comment

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

Tested as a daemonset as well as a system extension.

* update go mods, golang ci and k8s manifest
* split the tool into subcommands, leveraging cobra/viper
* refactored the logging, using a current framework (log/slog)
* repair project name "self-detection" and startup message
* moved reusable components into pkg/
* restricted accessibility, improved delegation/demaraction
* refactor connection to Talos API (consistent naming)
* refactor of toolbox command dispatching
* fetch uptime from Talos, instead of system
* use upstream GuestNicInfo (= less code to maintain)
* fix licensing (version.go was MPL by accident), reduce header bloat
* reduce talosquery subcommand complexity
* update README

BREAKING CHANGE: command line flags and env vars have been changed

Signed-off-by: Jorik Jonker <[email protected]>
@jonkerj jonkerj merged commit be56ecd into main Feb 11, 2025
11 checks passed
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.

4 participants