-
Notifications
You must be signed in to change notification settings - Fork 11
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
Corosync cmapctl gatherer #67
Conversation
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.
Nice @rtorrero ,
You will need to rebase from main to get the latest changes, which will break some tests I'm afraid hehe
Besides that, once this or the package_version
gatherer PRs are merge, we will need to rebase back again, as they have duplicated code for the command executor.
Finally, this new gatherer must be enabled in the factsengine
code, as corosyncconf is right now. Otherwise we cannot really use it.
I would try to compile the binary and run to see that it actually works:
./trento-agent facts gather --gatherer corosync-cmapctl --argument runtime.config.totem.consensus
) | ||
|
||
const ( | ||
CorosyncCmapCtlFactKey = "corosync-cmapctl" |
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.
In the package version gatherer I have used _
as "splitter". We should agree on this hehe
-
or _
?
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.
it's not really splitting anything, but reflecting the name of the binary as-is in the same way corosync.conf
is the fact key for the corosync configuration gatherer. I still understand the confusion and don't have a strong opinion on this, wdyt?
Thanks for the review, indeed I was missing enabling the gatherer in the facts engine. Seems to work correctly now:
|
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.
Perfect!
Green light from my side
fact := NewFactWithRequest(factReq, fmt.Sprint(value)) | ||
facts = append(facts, fact) | ||
} else { | ||
log.Warnf("%s gatherer: requested fact %s not found", CorosyncCmapCtlFactKey, factReq.Argument) |
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.
I have used log.Errorf
in other gatherers, but I guess it doesn't really matter that much.
Once we know how to populate the failed fact gatherings we will need to come back and finish the job hehe
This PR adds a gatherer to collect facts from the
corosync-cmapctl
binary and makes it available through our factsengineNote that I had to move the utils to a separate package as I was incurring in cyclic dependencies when attempting it to use it in the internal package