Skip to content

Conversation

mbobrovskyi
Copy link
Collaborator

Fixes / Features

  • Update AdmissionCheck depending on success/failure.

@mbobrovskyi mbobrovskyi changed the title Update AdmissionCheck depending on success/failure. WIP: [slice] Update AdmissionCheck depending on success/failure. Jul 9, 2025
@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch from cf51f5f to 6f0c2c6 Compare July 9, 2025 12:44
@mbobrovskyi mbobrovskyi changed the title WIP: [slice] Update AdmissionCheck depending on success/failure. [slice] Update AdmissionCheck depending on success/failure. Jul 9, 2025
@mbobrovskyi mbobrovskyi marked this pull request as ready for review July 9, 2025 12:46
@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch from 6f0c2c6 to de11b5e Compare July 9, 2025 13:27
@IrvingMg
Copy link
Collaborator

IrvingMg commented Jul 9, 2025

LGTM.

cc: @gabesaba @PBundyra

Comment on lines +150 to +170
if len(relevantChecks) == 0 {
return nil, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be exactly one? If yes, should we assert that that is the case?

If we have >1 slice for the workload, will we just use 1 AC?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, you right. Than I think we should merge #520 first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As we discussed, we don’t need to have multiple admission checks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we throw an error if there is more than 1, since this should never occur?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure, to be honest. Maybe we should create a webhook to validate whether an AdmissionCheck already exists. What do you think?

@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch 2 times, most recently from f1777b1 to 80c5088 Compare July 16, 2025 13:53
@mbobrovskyi mbobrovskyi requested a review from gabesaba July 16, 2025 13:54
@mbobrovskyi
Copy link
Collaborator Author

@gabesaba I've addressed all comments. Could you please take a look?

currentCondition := ptr.Deref(apimeta.FindStatusCondition(ac.Status.Conditions, kueue.AdmissionCheckActive), metav1.Condition{})
newCondition := metav1.Condition{
Type: kueue.AdmissionCheckActive,
Status: metav1.ConditionTrue,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a mechanism (in Kueue?) which eventually transitions this to false if this controller fails?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As I see in the provisioning request controller, we set it to False only when there is a validation error in the admission check config (see here). We are not using the admission check config, so we don’t need it. Therefore, I think we should just set it to true.

Comment on lines +150 to +170
if len(relevantChecks) == 0 {
return nil, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we throw an error if there is more than 1, since this should never occur?

@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch from 80c5088 to 3caa690 Compare July 25, 2025 10:39
@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch 2 times, most recently from 6b0683b to 07a7b68 Compare July 25, 2025 12:25
@mbobrovskyi mbobrovskyi force-pushed the slice/admission-check branch from 07a7b68 to abf65b0 Compare July 25, 2025 13:58
@mbobrovskyi mbobrovskyi requested a review from gabesaba July 25, 2025 14:01
return ctrl.Result{}, err
}
if err != nil {
return ctrl.Result{}, r.createSlice(ctx, wl, ac)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we create slice in this branch?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or, why do we return?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don’t have statuses on the Slice yet, so we need to stop reconciliation for now. Once we receive the status, we can restart reconciliation and handle it then.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think a package like this is a good idea. Nice :)

@gabesaba
Copy link
Collaborator

lgtm, thanks!

@gabesaba gabesaba merged commit d80d9c6 into slice-main Jul 28, 2025
14 of 17 checks passed
@gabesaba gabesaba deleted the slice/admission-check branch July 28, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants