-
Notifications
You must be signed in to change notification settings - Fork 98
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
NO-JIRA: feat: add gatherer name validation to gendocs #1075
base: master
Are you sure you want to change the base?
Conversation
This commit adds validation for gatherer names to validate that they follow the naming convention. Signed-off-by: Ondrej Pokorny <[email protected]>
cmd/gendoc/main.go
Outdated
reSampleArchive = regexp.MustCompile(`docs/(insights-archive-sample/.*)`) | ||
reGathererName = regexp.MustCompile("(?m)^###\\s*Config ID\\s*\\n`([^`]*)`") | ||
reGathererNameValidation = regexp.MustCompile("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") | ||
gathererNameExceptions = []string{"ContainersLogs"} |
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.
Is this exception here because of https://github.com/openshift/insights-operator/blob/master/pkg/gatherers/conditional/filter_and_gather_container_logs.go#L51 ?
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.
Yes, it has different structure and the regex does not match the gatherer name, because there is none.
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.
Perhaps we should add some name...I would rather avoid this kind of exceptions, because then it means it can't be disabled in the API right
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.
If it possible to add the name then let's do that
Signed-off-by: Ondrej Pokorny <[email protected]>
Signed-off-by: Ondrej Pokorny <[email protected]>
3c695ef
to
67d6e16
Compare
/retest |
1 similar comment
/retest |
@opokornyy: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed 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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncaak, opokornyy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@opokornyy: This pull request explicitly references no jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This commit adds validation for gatherer names to validate that they follow the naming convention.
This PR adds validation for gatherer names to validate that they follow the naming convention.
Categories
Sample Archive
None
Documentation
None
Unit Tests
None
Privacy
Yes. There are no sensitive data in the newly collected information.
Changelog
Breaking Changes
No
References
This is the PR that introduced the naming convention to openshift API for our CRDs (DataGather, InsightsDataGather)
openshift/api#2200