-
Notifications
You must be signed in to change notification settings - Fork 55
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
[DEVHAS-528] Add validating webhook for build-nudges-ref #401
Conversation
Signed-off-by: John Collier <jcollier@redhat.com>
Signed-off-by: John Collier <jcollier@redhat.com>
Signed-off-by: John Collier <jcollier@redhat.com>
return fmt.Errorf("component %s cannot be added to spec.build-nudges-ref as it belongs to a different application", nudgedComponentName) | ||
} | ||
|
||
err = r.validateBuildNudgesRefGraph(ctx, nudgedComponent.Spec.BuildNudgesRef, componentNamespace, componentName, componentApp) |
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 this case, it only checks the component being created. so I guess we assumes the created components have no ref cycles?
That makes sense actually.
just thinking any other edge cases can bypass the check and result in any cycles?
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 this case, it only checks the component being created. so I guess we assumes the created components have no ref cycles?
Yes, we don't validate other created components, as the webhook should have already validated those components when they were first created. It saves CPU cycles on a webhook that needs to complete before the resource can be created
Co-authored-by: Stephanie Cao <yangcao@redhat.com>
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.
change looks good
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johnmcollier, yangcao77 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 |
What does this PR do?:
This PR adds changes to the Component's validating webhook to handle the
build-nudges-ref
field:This PR also adds back the stub
Default()
functions for the Application and Component webhooks, as they were accidentally removed when migrating the webhooks from application-api. These functions will be needed to implement mutating webhooks as part of DEVHAS-529Which issue(s)/story(ies) does this PR fixes:
https://issues.redhat.com/browse/DEVHAS-528
PR acceptance criteria:
Unit/Functional tests
Documentation
N/A
N/A
How to test changes / Special notes to the reviewer: