-
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
Port cibadmin gatherer #149
Conversation
7a275da
to
719f4a7
Compare
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.
Looks good to me.
The only doubt that I have is that current checks are using cibadmin -Q --xpath WHATEVER
rather than cibadmin --query --local
.
Maybe they are the same, or we can achieve the same result, and I am missing something, though 😅
// nolint:gochecknoglobals | ||
var ( | ||
CibAdminCommandError = entities.FactGatheringError{ | ||
Type: "cibadmin-command-error", | ||
Message: "error running cibadmin command", | ||
} | ||
|
||
CibAdminDecodingError = entities.FactGatheringError{ | ||
Type: "cibadmin-decoding-error", | ||
Message: "error decoding cibadmin output", | ||
} | ||
) |
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.
@CDimonaco are you aware of some other way to declare this stuff both cleanly and without pissing off the linter? I don't like globals, but I have to say I like what @arbulu89 did here.
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 any case, is not something I made up here. We have been using this way in all the gatherers since we started the porting
This is because we won't use About the |
719f4a7
to
11c5bff
Compare
e0e82c7
to
ae041b6
Compare
Hey @fabriziosestito , You can actually put many entries in the same case line |
As an improvement of the casting to string the next code would work:
But in the current scenario I prefer a bit less efficient code which is easier to follow. |
cibadmin gatherer. It tranfsorms the xml output of
cibadmin
command and it converts it to a map, so we can access all the fields.As xml->json transformation cannot be done without having real xml struct domain data, I needed to transform some well done values always to list (primitive, master, etc). These values are lists, but the
mxj
cannot know that, if we only have 1 entry. That's why we convert them.Usage: