Repository navigation
fix(cli): warn when runtime.adapter.type is ignored - #2534
Merged
Merged
Conversation
DIRECTORY_DAEMON_RUNTIME_ADAPTER_TYPE=process sets runtime.adapter.type, but EffectiveAdapterTypes prefers runtime.adapter_types, which the shipped config always sets. The daemon kept starting docker and process and said nothing about the discarded setting. The precedence stays the same. runtime.adapter.type loses its default, so a value now means someone set it, and the daemon logs a warning naming the variable that works when the list overrides it. EffectiveAdapterTypes falls back to docker itself, so a --config file that sets neither key still runs docker alone. The shipped config's comment names both variables. Fixes agntcy#2530 Signed-off-by: Uvesh Menpur <[email protected]>
tkircsi
approved these changes
Nov 23, 2026
tkircsi
left a comment
Contributor
There was a problem hiding this comment.
Thanks @uveshm003 for turning this around so fast! Nice fix — matches what the issue proposed, and the two halves work well together: dropping the default for runtime.adapter.type is what keeps the warning quiet on a normal start, and the docker fallback preserves today's behaviour. I confirmed no shipped config ever carried both keys, so nobody gets a spurious warning. Tests and lint clean on my side too.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2530
This follows the fix suggested in the issue. The precedence doesn't change.
runtime.adapter.typeno longer has a default (BindEnvinstead ofSetDefault), so a non-empty value means someone set it.EffectiveAdapterTypesreturnsdockeras the last resort instead ofnil. A--configfile that sets neither key still starts docker alone, as it does today.startRuntimeDiscoverylogs a warning whenadapter_typesoverridesadapter.type. The check is "the list is set", not "the list lacks this type", soADAPTER_TYPE=processwarns even thoughprocessis in the default list.adapter_typesindaemon.config.yamlnamesDIRECTORY_DAEMON_RUNTIME_ADAPTER_TYPES.Testing
go test ./cmd/daemon/...incli. New cases inruntime_test.go:--configfile with neither key: docker.golangci-lintv2.14.0 with the repo config: 0 issues.dirctl daemon startwithDIRECTORY_DAEMON_RUNTIME_ENABLED=true DIRECTORY_DAEMON_RUNTIME_ADAPTER_TYPE=process:Without the variable there's no warning, and docker and process start as before.