-
Notifications
You must be signed in to change notification settings - Fork 17
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
Label Templates: rework collection of 'System Data' info #840
Conversation
Allow automatic conversion of data to map[string]interface{} (Template Labels format) using reflection. Add support to old variable names (to be deprecated sooner or later) and add SMBIOS data collection from hostinfo package: this should allow to drop dmidecode tool requirement for SMBIOS data retrieval.
also changed the 'raw' option to 'full' one, to allow dumping all the available information using the same reflection based translation as (partially) done with the regular collected Label Templates.
the hostinfo package is now able to collect all the data, also the SMBIOS one: drop the dmidecode package. Signed-off-by: Francesco Giudici <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice utility we have here!
cmd/register/showdata.go
Outdated
|
||
cmd.Flags().BoolVarP(&full, "full", "f", false, "dump full, raw data before postprocessing to refine available label templates variables") | ||
_ = viper.BindPFlag("full", cmd.Flags().Lookup("full")) | ||
cmd.Flags().StringVarP(&output, "output", "o", "json", "output format ['"+OUTYAML+"', '"+OUTJSON+"', '"+OUTJSONCOMPACT+"']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: could just be --format
instead of --output
.
Signed-off-by: Francesco Giudici <[email protected]>
output --> format full --> raw Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Closing in favor of #843 : reviewed the variable names and kept the old smbios and hardware legacy labels for now. |
Allow automatic conversion of data to map[string]interface{} (Label Templates format) using reflection.
Add support to "old" variable names (that we may want to deprecate sooner or later, in the meanwhile we can just document the new syntax only) and add SMBIOS data collection from hostinfo package.
Drop dmidecode package as we SMBIOS data retrieval is now performed by the hostinfo package.
No more requirement on the dmidecode tool.
Fixes #834