The driver.Auth interface was describing the configfile.GetAuthConfig
implementation; define a local interface instead of using buildx's
definition as an intermediate.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Until now, mustRecreate logic only checked for divergence in TypeVolume
mounts but ignored TypeImage mounts. This inconsistency caused containers
to erroneously retain stale images even after the source image was rebuilt.
This commit updates ensureImagesExists to resolve image volume sources to
their digests using the official reference package. This enables ServiceHash
(config hash) to naturally detect underlying image digest changes,
triggering recreation via the standard convergence logic.
An E2E test case is added to verify this behavior.
Fixes#13547
Signed-off-by: ibrahim yapar <74625807+ibrahimypr@users.noreply.github.com>
The condition for checking container restart state had incorrect operator
precedence. The expression:
inspect.State != nil && inspect.State.Restarting || inspect.State.Running
is evaluated as:
(inspect.State != nil && inspect.State.Restarting) || inspect.State.Running
This means if inspect.State is nil and inspect.State.Restarting is false
(which would trigger a panic), the code would attempt to access
inspect.State.Running, causing a nil pointer dereference.
This fix adds parentheses to ensure the nil check applies to both
state checks:
inspect.State != nil && (inspect.State.Restarting || inspect.State.Running)
Signed-off-by: Nepomuk Crhonek <105591323+Nepomuk5665@users.noreply.github.com>
Add linter rules to prevent usage of context.Background() and
context.TODO() in test files - t.Context() should be used instead.
The rules only apply to *_test.go files, not production code.
Note: os.Setenv is not covered by forbidigo due to a limitation where
it only catches calls when the return value is assigned. However,
errcheck will flag unchecked os.Setenv calls.
Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
Use t.TempDir() which automatically cleans up the temporary directory
when the test completes, eliminating the need for manual cleanup.
Go 1.14 modernization pattern.
Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
Use t.Setenv() which automatically restores the original value when
the test completes, eliminating the need for manual cleanup.
Go 1.18 modernization pattern.
Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
Replace manual context creation with t.Context() which is automatically
cancelled when the test completes.
Go 1.24 modernization pattern.
Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
Ensured all watcher and sync goroutines and channels are robustly closed on context cancellation or error.
Added explicit logging for large batches and context cancellation to prevent stuck processes and ensure graceful shutdown on Ctrl-C.
Signed-off-by: Amol Yadav <amyssnipet@yahoo.com>
Currently when using models, the final message is 'confugiring' which could let users think the DMR configuration is still pending
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
# Conflicts:
# pkg/api/event.go
Most files already grouped imports into "stdlib -> other -> local",
but some files didn't. The gci formatter is similar to goimports, but
has better options to make sure imports are grouped in the expected
order (and to make sure no additional groups are present).
This formatter has a 'fix' function, so code can be re-formatted auto-
matically;
golangci-lint run -v --fix
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>