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

test: add MinAllocForJob helper #20474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

gulducat
Copy link
Member

Useful for making multiple allocations for the same job.

@gulducat gulducat added backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels Apr 22, 2024
Comment on lines +93 to 95
func MinAllocForJob(job *structs.Job) *structs.Allocation {
group := job.TaskGroups[0]
task := group.Tasks[0]
Copy link
Member Author

Choose a reason for hiding this comment

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

accepting any ol' Job opens up the possibility of panics if a caller provides a job with no groups or tasks, but the stack trace will not be very mysterious to a caller holding it wrong.

@tgross tgross added stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows and removed backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants