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

session: ensure 'tilt ci' exits properly when reattaching to jobs #6276

Merged
merged 2 commits into from Dec 8, 2023

Conversation

nicks
Copy link
Member

@nicks nicks commented Dec 5, 2023

fixes #6272

History of this change:

in any case, i added a bunch of tests, since we need more job integration tests anyway.

dnephin and others added 2 commits December 5, 2023 18:01
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
fixes tilt-dev#6272

History of this change:
- we used to have a very naive definition of "Ready"
- callers of the runtime status API had hacks to look at Job pods to determine completeness (tilt-dev#4367)
- later, we changed it to have a more sophisticated definition, so that
  Jobs only count as 'ready' when they're complete. (tilt-dev#5013)
- we forgot to remove the old caller hacks :grimace:

in any case, i added a bunch of tests, since we need more job integration tests anyway.

Signed-off-by: Nick Santos <nick.santos@docker.com>
@nicks
Copy link
Member Author

nicks commented Dec 5, 2023

cc @dnephin

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

Comment on lines +435 to +442
krs.HasEverDeployedSuccessfully = true
// There are no pods but the job completed successfully.
krs.Conditions = []metav1.Condition{
{
Type: v1alpha1.ApplyConditionJobComplete,
Status: metav1.ConditionTrue,
},
}
Copy link
Contributor

@dnephin dnephin Dec 6, 2023

Choose a reason for hiding this comment

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

I think some or all of these lines are no longer necessary for the test to pass (but I haven't actually confirmed that by trying it).

Suggested change
krs.HasEverDeployedSuccessfully = true
// There are no pods but the job completed successfully.
krs.Conditions = []metav1.Condition{
{
Type: v1alpha1.ApplyConditionJobComplete,
Status: metav1.ConditionTrue,
},
}

Copy link
Member Author

Choose a reason for hiding this comment

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

nope! these fields are used to infer runtime state, see

if meta.IsStatusConditionTrue(s.Conditions, v1alpha1.ApplyConditionJobComplete) {

@nicks nicks merged commit e850ee8 into tilt-dev:master Dec 8, 2023
9 checks passed
@nicks nicks deleted the nicks/issue6272 branch December 8, 2023 20:50
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.

Job never becomes ready when re-attaching to exiting env when pods for the job are deleted
2 participants