-
Notifications
You must be signed in to change notification settings - Fork 8
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
Validate Agent Name by Format and Binary #119
Validate Agent Name by Format and Binary #119
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: razo7 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 |
/test 4.14-openshift-e2e |
/test 4.14-openshift-e2e |
/test 4.14-openshift-e2e |
/test 4.14-openshift-e2e |
Use kubebuilder validation to validate fence agent format - has fence_ prefix
Run 'operator-sdk create webhook --group fence-agents-remediation --version v1alpha1 --kind FenceAgentsRemediation --programmatic-validation'
Use Webhook to verify agent name match an agent under /usr/sbin directory
0e32fc7
to
a1d1e2d
Compare
/test 4.14-openshift-e2e |
…hook Use Webhook to verify agent name match an agent under /usr/sbin directory
a1d1e2d
to
15391cb
Compare
/test 4.14-openshift-e2e |
Create new interface AgentValidator with new struct validateAgentExistence to mock os.Stat function, since it is not needed on in unit tests, but still want to use it in production code
/test 4.14-openshift-e2e |
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 left some comments
Sorry, somehow my editor pushed the same review twice |
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 found it a bit complicated to read the changes.
IMHO "separation of concerns" can be improved, by not using anything about files in the webhook, and not using anything about webhooks in the validator.
I wasn't sure if the result is that much better, so I gave it a try. Code might clarify my comments :D Feel free to pick those changes where you agree that it's better.
Use explicit error messages to find, use os.stat by default in far webhook, and dummy validation in webhook pacakage
/test 4.14-openshift-e2e |
/lgtm |
/retest |
Agent field in far or farTemplate has not been verified.
fence_
prefix)/usr/sbin
directory)ECOPROJECT-1753