Conversation
Add doc comments at the points where the experimentalCLI, swarm, and ostype command/flag annotations are checked, noting whether each is a client-side/build-time check (experimentalCLI) or evaluated against the connected daemon's reported state (swarm, ostype). No behavior change. Ref docker#1363 Signed-off-by: anmol0705 <anmol752005@gmail.com>
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.
Problem
#1363 asks for clarity on which command/flag annotations are evaluated client-side vs. server-side. This wasn't documented anywhere near the actual check sites.
What I found
experimentalCLI: client-side, build-time only.isExperimental()incli/cobra.goreads only the staticAnnotationsmap (and parent commands viaVisitParents) — no dependency on a connected daemon at all.swarm: server-side. Checked incli/cobra.goagainst the connected daemon's reported swarm state (ServerInfo/SwarmStatus).ostype: server-side. Checked incmd/docker/docker.go(notOSType,isOSTypeSupported) against the connected daemon'sServerInfo().OSType."experimental"(non-CLI) annotation anywhere in the current tree — onlyexperimentalCLI. If Clarify command annotations for server or client side #1363 intended something else there, happy to adjust.Change
Doc comments only, at the point where each annotation is defined/checked, explaining what it means and whether it's client- or server-evaluated. No behavior change — verified via
go build(excluding the pre-existing, unrelatedinternal/gocompatbuild issue onmaster, confirmed viagit stashcomparison) andgofmt -l.This is intentionally the smallest version of a fix — I asked on the issue whether something larger (a dedicated docs page, typed annotation constants) was wanted and haven't heard back yet, so I'm proposing this minimal version first since it's low-risk and easy to build on if more is wanted.
Fixes #1363