-
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
Resolver gatherer #274
Resolver gatherer #274
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.
@rtorrero Some initial comments about the generic logic of the code
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.
Looking good @rtorrero
Good progress
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.
More comments
ed99aea
to
55d8719
Compare
5b37fcd
to
dee2be1
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.
I think the code looks good, I'm requesting changes not on the logic itself, but on style and readability
Anyway GJ
e23cd56
to
360197b
Compare
@CDimonaco @arbulu89 thanks for the reviews, I think I've addressed everything, the only thing that I'm not 100% I did accordingly was the mocks, I didn't fully understand @arbulu89 proposal but I think I came up with a solution that addresses the main concern of not adding stuff to the utils when it's not being used elsewhere. In addition to the comments, I also:
|
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.
Suggestions from my side
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.
@rtorrero Great! It looks good now.
Now....
the most difficult thing. Naming XD
I would vote for SapInstanceNameResolver
or SapInstanceResolver
or SapHostnameResolver
, with preference for the first.
And the gatherer name would be sap_instancename_resolver
maybe.
@abravosuse any idea?
google.golang.org/protobuf v1.31.0 | ||
) | ||
|
||
require ( | ||
github.com/d-tux/go-fstab v0.0.0-20141204152952-eb4090f26517 | ||
github.com/iancoleman/strcase v0.2.0 | ||
github.com/spf13/afero v1.9.5 |
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 don't know why golang moves this to other require
. Mysteries XD
hostnameRegexCompiled = regexp.MustCompile(`(.+)_(.+)_(.+)`) // <SID>_<InstanceNumber>_<Hostname> | ||
regexSubgroupsCount = 4 | ||
SapInstanceHostnameResolverDetailsError = entities.FactGatheringError{ | ||
Type: "sapinstance_hostname_resolver-details-error", |
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 other gatherers package_version
, even though gatherer uses _
, we use -
here.
I don't want to create a big fuzz about that, but just wanted to comment hehe
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.
no worries, I can change it
2aab482
to
8bc4bb4
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.
Hey nice work, lgtm :D
This PR adds a resolver gatherer, it uses the filesystem to search for running sap systems and the profile data to get the virtual hostnames associated to each instance of the sap system. It will then attempt to resolve those hostnames to confirm that the OS knows about them.