Skip to content
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

Record an event and set status message when creation of provisioning request fails #3056

Conversation

IrvingMg
Copy link
Contributor

@IrvingMg IrvingMg commented Sep 16, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

It produces an event when an error during provisioning request creation occurs.

Which issue(s) this PR fixes:

Fixes #3025

Special notes for your reviewer:

Does this PR introduce a user-facing change?

ProvisioningRequest: Record the ProvisioningRequest creation errors to event and ProvisioningRequest status.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 16, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 16, 2024
Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 5b2560b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67056480a74a5000075407c9

@IrvingMg
Copy link
Contributor Author

/test all

@IrvingMg
Copy link
Contributor Author

/cc @mbobrovskyi @trasc

@IrvingMg IrvingMg marked this pull request as ready for review September 17, 2024 07:31
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2024
@IrvingMg
Copy link
Contributor Author

/retest-required

@tenzen-y
Copy link
Member

tenzen-y commented Oct 1, 2024

/assign @mbobrovskyi

@IrvingMg IrvingMg force-pushed the feature/surface-error-when-podtemplate-provreq-invalid branch from d41375e to 97d43a7 Compare October 7, 2024 23:33
Copy link
Contributor

@trasc trasc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9b930ac0d5e99f8cc024ec26ab7f21b27d4cb5e1

Copy link
Contributor

@mimowo mimowo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a nit

pkg/controller/admissionchecks/provisioning/controller.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2024
@mbobrovskyi
Copy link
Contributor

/lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1f284b59ee185cb45bd8e18179373bd842fcdd39

@mimowo
Copy link
Contributor

mimowo commented Oct 9, 2024

/lgtm
/approve
Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IrvingMg, mimowo

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2024
@k8s-ci-robot k8s-ci-robot merged commit 355c447 into kubernetes-sigs:main Oct 9, 2024
15 of 16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.9 milestone Oct 9, 2024
@trasc trasc deleted the feature/surface-error-when-podtemplate-provreq-invalid branch October 9, 2024 06:36
@@ -302,6 +303,10 @@ func (c *Controller) syncOwnedProvisionRequest(ctx context.Context, wl *kueue.Wo
}

if err := c.client.Create(ctx, req); err != nil {
ac.Message = fmt.Sprintf("Error creating ProvisioningRequest %q: %v", requestName, err)
Copy link
Contributor

@mimowo mimowo Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IrvingMg it just occurred to me - could you please follow up to use the TruncateConditionMessage, and TruncateEventMessage helpers to make sure the message is not too long?

It shouldn't be a problem in most cases, but since the message may come from custom webhooks it may be arbitrarily long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this is user-facing new feature. Hense, the release note would be helpful.

/release-note-edit

MultiKueue: Record the ProvisioningRequest creation errors to event and ProvisioningRequest status.

@tenzen-y
Copy link
Member

/release-note-edit

MultiKueue: Record the ProvisioningRequest creation errors to event and ProvisioningRequest status.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 11, 2024
@mimowo
Copy link
Contributor

mimowo commented Oct 11, 2024

I think we should drop the "MultiKueue: " - this is not used in MultiKueue. In fact, currently ProvisioningRequests and MultiKueue aren't working together.

@tenzen-y
Copy link
Member

I think we should drop the "MultiKueue: " - this is not used in MultiKueue. In fact, currently ProvisioningRequests and MultiKueue aren't working together.

Oh, you're right. Let me revise the release-note.

@tenzen-y
Copy link
Member

/release-note-edit

ProvisioningRequest: Record the ProvisioningRequest creation errors to event and ProvisioningRequest status.

@mimowo
Copy link
Contributor

mimowo commented Oct 11, 2024

/retitle Record an event and set status message when creation of provisioning request fails

@k8s-ci-robot k8s-ci-robot changed the title Record an event when provisioning request fails Record an event and set status message when creation of provisioning request fails Oct 11, 2024
kannon92 pushed a commit to openshift-kannon92/kubernetes-sigs-kueue that referenced this pull request Nov 19, 2024
* Record an event when provisioning request fails

* Update event reason

* Expose ProvReq error as a status

* Include error details into status message

* Use interceptor funcs for testing

* Avoid code duplication for error message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surface errors when a PodTemplate or a ProvReq is invalid
8 participants