-
Notifications
You must be signed in to change notification settings - Fork 58
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
Check hook additional changes #1719
Conversation
|
||
if err != nil { | ||
log.Info("error executing check hook", "for", hook.Name, "with error", err) | ||
errOut = err |
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.
@asn1809 , when we have real failure here, I mean not res = false, but err is not empty, do we need to proceed in this loop?
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.
Thanks @ELENAGER, the reason is to fail the hook if any of the checks fail. For example, suppose a labelSelector or nameSelector returns 2 Deployments, and check hook passes for one and fails for other, then overall check hook should be marked as failed. Let me know if you see any issues.
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.
@Annaraya-Narasagond , exactly, maybe just
return false, err
in line 83?
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.
Done
For check hooks to be executed for the resource type pod, deployment or statefulset, either nameSelector or labelSelector are mandatory. nameSelector can be: 1. Distinct name which will match with exact name of the resource. 2. Regex, which may match with multiple resources. labelSelector spec is according to meta/v1. If multiple resources are found, then check hook will be executed on all the resources and res will be logged for each of the resource. Signed-off-by: Annaraya Narasagond <[email protected]>
93c0b32
to
d8d2b89
Compare
Signed-off-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Annaraya Narasagond <[email protected]>
Fixes #1697