Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

info: remove printServerWarningsLegacy #4808

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jan 20, 2024

Relates to:

Docker Engine 18.09 (API v1.39) introduced a Warnings field in the into response. This enhancement was not gated by API version (see moby/moby@a3d4238), and will be returned by Docker Engine 18.09 and up, regardless of the API version chosen.

Likewise, the client-side code was written to prefer warnings returned by the daemon, but to fall back on client-side detection of missing features based on information in the Info response (see docker/cli@3c27ce2).

Thse warnings are purely informational, and given that Docker Engine versions before 18.09 have reached EOL 6 Years ago, and any current version of the Engine now returns the Warnings, it should be safe to remove the client-side fall back logic.

This patch removes the client-side fall back code for warnings that was added in 3c27ce2.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Docker Engine 18.09 (API v1.39) introduced a Warnings field in the into response.
This enhancement was not gated by API version (see [moby/moby@a3d4238]), and
will be returned by Docker Engine 18.09 and up, regardless of the API version
chosen.

Likewise, the client-side code was written to prefer warnings returned by
the daemon, but to fall back on client-side detection of missing features
based on information in the Info response (see [docker/cli@3c27ce2]).

Thse warnings are purely informational, and given that Docker Engine versions
before 18.09 have reached EOL 6 Years ago, and any current version of the
Engine now returns the Warnings, it should be safe to remove the client-side
fall back logic.

This patch removes the client-side fall back code for warnings that was
added in 3c27ce2.

[moby/moby@a3d4238]: moby/moby@a3d4238
[docker/cli@3c27ce2]: docker@3c27ce2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Jan 20, 2024
@thaJeztah thaJeztah added this to the 26.0.0 milestone Jan 20, 2024
@thaJeztah thaJeztah self-assigned this Jan 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2024

Codecov Report

Merging #4808 (a71d39b) into master (f18a476) will decrease coverage by 0.05%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4808      +/-   ##
==========================================
- Coverage   59.63%   59.58%   -0.05%     
==========================================
  Files         287      287              
  Lines       24777    24741      -36     
==========================================
- Hits        14775    14742      -33     
+ Misses       9114     9112       -2     
+ Partials      888      887       -1     

Copy link
Contributor

@krissetto krissetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

How do we handle comms when removing cli features necessary for EOL versions of the engine? Anything special that needs to be done?

@thaJeztah
Copy link
Member Author

thaJeztah commented Jan 23, 2024

How do we handle comms when removing cli features necessary for EOL versions of the engine? Anything special that needs to be done?

So far, the CLI "supported" all versions of docker since 1.0.0; most of that is based on API version; the client can downgrade to older versions of the API, where needed changing API calls, or disabling features not yet supported. And the CLI itself has some detection as well; there's some flags and commands that are hidden when the CLI is connected to an older engine.

Most of that was introduced to help transitioning to newer daemons, so for situations where a user updated the CLI to the latest version, but the server they connected to has not yet been updated (a more likely scenario in production setups, where you may not update your daemon to "new version" on day one). Before API version negotiation, users often ran into "this daemon is too old" errors.

API versions before "previous" should work (as mentioned, all the way back to v1.0.0), but that should really be considered "best effort" (it should mostly work , but it's definitely not tested).

If we actively deprecate features, we add those to the deprecated.md page in this repository; on that page, we announce a feature to be deprecated, and an (estimated) version in which the feature will be removed. It depends a bit on the feature how long there's between deprecating and removing; some options are "ok" to remove fast, others may need a proper deprecation cycle, which may (in the extreme case) be multiple releases;

  1. announce deprecation
  2. print warnings (with link to relevant information in the docs)
  3. disable by default (but an escape hatch)
  4. remove but produce custom, informative error
  5. full removal

In this case, the removed functionality was not essential, and would only be produced for (very) old, and long EOL versions of the daemon. Anyone still running those has a MUCH bigger problem.

@thaJeztah thaJeztah merged commit c6ae749 into docker:master Jan 23, 2024
77 checks passed
@thaJeztah thaJeztah deleted the remove_printServerWarningsLegacy branch January 23, 2024 17:23
@krissetto
Copy link
Contributor

Thanks for the thorough explanation @thaJeztah!

@thaJeztah
Copy link
Member Author

You're welcome! We should consider having some of this actually written up (I don't think expectations have ever been properly documented) /cc @dvdksn (low priority, just one to put in the back of your mind)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants