fix: use imageID in createAndStartContainer (closes #124)
All checks were successful
Check / check (pull_request) Successful in 11m24s
All checks were successful
Check / check (pull_request) Successful in 11m24s
Wire the imageID parameter (returned from docker build) through createAndStartContainer and buildContainerOptions instead of reconstructing a mutable tag via fmt.Sprintf. This ensures containers reference the immutable image digest, avoiding tag-reuse races when deploys overlap. Changes: - Rename _ string to imageID string in createAndStartContainer - Change buildContainerOptions to accept imageID string instead of deploymentID int64 - Use imageID directly as the Image field in container options - Update rollback path to pass previousImageID directly - Add test verifying imageID flows through to container options - Add database.NewTestDatabase and logger.NewForTest test helpers
This commit is contained in:
11
internal/logger/testing.go
Normal file
11
internal/logger/testing.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package logger
|
||||
|
||||
import "log/slog"
|
||||
|
||||
// NewForTest creates a Logger wrapping the given slog.Logger, for use in tests.
|
||||
func NewForTest(log *slog.Logger) *Logger {
|
||||
return &Logger{
|
||||
log: log,
|
||||
level: new(slog.LevelVar),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user