SUSE / connect-ng

Other
9 stars 16 forks source link

collectors: Add cpu and socket detection #221

Closed felixsch closed 5 months ago

felixsch commented 5 months ago

card: https://trello.com/c/BiyCjXXG/3316-tedd-reimplement-cpu-information-gathering

Read values from lscpu for any architecture and remove s390x specific implementation since util-linux is available on all platforms now (in contrary to the initial implementation 10 years ago).

This also uses a more parsable output of lscpu. Check lscpu -p for more information.

How to test this change:

$ docker run --rm -it -h some-test-name -v $(pwd):/test registry.suse.com/bci/golang:1.21-openssl
> cd /test
> git config --global --add safe.directory /test
> make build
> ./out/suseconnect -r <regcode>
> ./out/suseconnect --debug --keepalive
# expect: Check the output for the payload sent to SCC and make sure it is matching your cpu and socket count

As always, if you have question, or need help testing this change, do not hesistate to reach out!:rocket:

Thank you very much! :green_heart: