Skip to content

docs: clarify client- vs server-side evaluation of command annotations - #7303

Open
anmol0705 wants to merge 1 commit into
docker:masterfrom
anmol0705:docs/issue-1363/clarify-annotation-scope
Open

anmol0705 wants to merge 1 commit into
docker:masterfrom
anmol0705:docs/issue-1363/clarify-annotation-scope

Conversation

@anmol0705

Copy link
Copy Markdown

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() in cli/cobra.go reads only the static Annotations map (and parent commands via VisitParents) — no dependency on a connected daemon at all.
  • swarm: server-side. Checked in cli/cobra.go against the connected daemon's reported swarm state (ServerInfo/SwarmStatus).
  • ostype: server-side. Checked in cmd/docker/docker.go (notOSType, isOSTypeSupported) against the connected daemon's ServerInfo().OSType.
  • I could not find a plain "experimental" (non-CLI) annotation anywhere in the current tree — only experimentalCLI. 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, unrelated internal/gocompat build issue on master, confirmed via git stash comparison) and gofmt -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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify command annotations for server or client side

1 participant