-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Perserve device ids in in-place alloc updates #7762
Conversation
When an alloc is updated in-place, test that the allocated devices are preserved in new alloc struct.
When an alloc is updated in-place, ensure that the allocated device are preserved and carried over to new alloc.
[ci skip]
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.
LGTM
if existing.AllocatedResources != nil { | ||
if tr, ok := existing.AllocatedResources.Tasks[task]; ok { | ||
networks = tr.Networks | ||
devices = tr.Devices | ||
} | ||
} else if tr, ok := existing.TaskResources[task]; ok { | ||
networks = tr.Networks |
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.
In 0.11, existing.AllocatedResources
should always be non-nil. The type of existing.TaskResources[task].Devices
is different, so I didn't bother making the compatibility path.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
When an alloc is updated in-place, ensure that any devices that are allocated to it are preserved and carried over to the new allocation struct.
I've added the test first, so one can see the failure in https://circleci.com/gh/hashicorp/nomad/60422, which is green in the follow up fix.
This builds up upon the work of @xsikor in #7697 . Thanks!
Fix #7696
Closes #7697