-
Notifications
You must be signed in to change notification settings - Fork 113
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
Emit events for BuildRun objects #824
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bb48ab0
to
abf31bc
Compare
Enhance the BuildRun controller to emit k8s events when build runs start and complete. If a BuildRun fails, a Warning event is issued. Includes updates to the BuildRun documentation.
abf31bc
to
c85cf2f
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.
Generally something that is valuable. But, my first reaction honestly was: hm, I might have missed that ep/shp. There, we could have thought about the events that we want to emit; whether we want to make the feature configurable or not.
} | ||
|
||
// recordBuildRunCompleted records the appropriate event if the provided BuildRun has completed. | ||
func (r *ReconcileBuildRun) recordBuildRunCompleted(buildRun *buildv1alpha1.BuildRun) { |
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.
My few cents: the function names sound generic and not related to events. The metrics calls could therefore also go in here. What I tend to prefer more is that the event creation code is moved to a separate file.
@@ -126,6 +126,7 @@ func (r *ReconcileBuildRun) Reconcile(request reconcile.Request) (reconcile.Resu | |||
// Set OwnerReference for Build and BuildRun only when build.shipwright.io/build-run-deletion is set "true" | |||
if build.GetAnnotations()[buildv1alpha1.AnnotationBuildRunDeletion] == "true" && !resources.IsOwnedByBuild(build, buildRun.OwnerReferences) { | |||
if err := r.setOwnerReferenceFunc(build, buildRun, r.scheme); err != nil { | |||
// TODO - why are we setting this on the Build object instead of the BuildRun object? |
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 personally prefer that issues are opened instead of adding TODOs in unrelated pull requests that nobody will work on.
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.
Opened #827 - I'll drop this comment
@adambkaplan I agree on what Sascha mentioned, we should send this via a SHIP first. I´m doing the same in #787 (comment) . |
@adambkaplan: PR needs rebase. 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/test-infra repository. |
/close Will reconsider/reopen this after discussing in a SHIP. |
@adambkaplan: Closed this PR. 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 kubernetes/test-infra repository. |
Changes
Enhance the BuildRun controller to emit k8s events when build runs start
and complete. If a BuildRun fails, a Warning event is issued.
This is an initial implementation for #823
/kind feature
Submitter Checklist
Release Notes