fix: use imageID in createAndStartContainer (closes #124) #127
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
notplanned
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#127
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/use-image-id-in-container"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wire the
imageIDparameter (returned from docker build) throughcreateAndStartContainerandbuildContainerOptionsinstead of reconstructing a mutable tag viafmt.Sprintf.This ensures containers reference the immutable image digest, avoiding tag-reuse races when deploys overlap.
Changes
_ stringtoimageID stringincreateAndStartContainerbuildContainerOptionsto acceptimageID stringinstead ofdeploymentID int64imageIDdirectly as theImagefield in container optionspreviousImageIDdirectly (removing redundant override)database.NewTestDatabaseandlogger.NewForTesttest helpersmake check
Code Review: ✅ LGTM
Summary: Fixes
buildContainerOptionsto use the actual Docker image ID instead of constructing a tag fromdeploymentID. Also fixes rollback to passimageIDcorrectly.Changes reviewed:
buildContainerOptionsnow acceptsimageID stringinstead ofdeploymentID int64— correctcreateAndStartContainerpassesimageIDthrough properly — correctpreviousImageIDdirectly tobuildContainerOptionsinstead of overwritingopts.Imageafter the fact — cleanerTestBuildContainerOptionsUsesImageID) validates the fixdatabase/testing.go,logger/testing.go,export_test.go) are cleanmake check: PASS — all tests pass, build succeeds.Labeled
merge-ready, assigned to @sneak.