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

add d_type warning to docker info, and optimize output #31290

Merged
merged 1 commit into from
Feb 28, 2017

Conversation

thaJeztah
Copy link
Member

- What I did

The overlay(2) drivers were moved up in the list of storage drivers, and are known to have problems if the backing filesystem does not support d_type.

Commit 2e20e63 added a warning, which is logged in the daemon logs, however, many users do not check those logs, and may overlook this warning.

This patch adds the same warning to the output of docker info so that the warning is more easily found.

In addition, the output of warnings printed by docker info is optimized, by;

  • moving all warnings to the end of the output, instead of mixing them with the regular output
  • wrapping the storage-driver warnings, so that they are more easily readable

Example output with this patch applied

devicemapper using loopback devices:

...
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
         Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

overlay2 on xfs without d_type support;

...
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: overlay2: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
         Reformat the filesystem with ftype=1 to enable d_type support.
         Running without d_type support will not be supported in future releases.
WARNING: bridge-nf-call-iptables is disabled

- Description for the changelog

Add warning to docker info if the overlay(2) storage driver is used , and the backing filesystem does not support d_type.

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

c9a44666b77a955923fb3f48fdf2e7ee

The overlay(2) drivers were moved up in the list of storage drivers,
and are known to have problems if the backing filesystem does not
support d_type.

Commit 2e20e63 added a warning,
which is logged in the daemon logs, however, many users do not
check those logs, and may overlook this warning.

This patch adds the same warning to the output of `docker info`
so that the warning is more easily found.

In addition, the output of warnings printed by `docker info` is
optimized, by;

- moving all warnings to the _end_ of the output, instead of
  mixing them with the regular output
- wrapping the storage-driver warnings, so that they are more
  easily readable

Example output with this patch applied
============================================

devicemapper using loopback devices:

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
             Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

overlay2 on xfs without d_type support;

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: overlay2: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
             Reformat the filesystem with ftype=1 to enable d_type support.
             Running without d_type support will not be supported in future releases.
    WARNING: bridge-nf-call-iptables is disabled

Signed-off-by: Sebastiaan van Stijn <[email protected]>
fmt.Fprintln(dockerCli.Err(), "WARNING: bridge-nf-call-iptables is disabled")
}
if !info.BridgeNfIP6tables {
fmt.Fprintln(dockerCli.Err(), "WARNING: bridge-nf-call-ip6tables is disabled")
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW, I'm thinking of moving generating these warnings on the daemon side, and return them through the API. Doing so allows API clients to make use of these warnings, and also have each platform (windows, linux) to return platform-specific warnings, without requiring the client to have this knowledge.

The current code would still be needed for backward-compatibility of course, so it may introduce some duplication

@tonistiigi
Copy link
Member

LGTM

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐸

@vdemeester vdemeester merged commit 38d985a into moby:master Feb 28, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.04.0 milestone Feb 28, 2017
@thaJeztah thaJeztah deleted the print-d_type_warning branch February 28, 2017 15:41
@vieux
Copy link
Contributor

vieux commented Mar 29, 2017

@thaJeztah why the cherry-pick here ? it's already in 17.04.0-rc1

@thaJeztah
Copy link
Member Author

@vieux yes, looks like it was to consider it for 17.03.1

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
add d_type warning to docker info, and optimize output
@thaJeztah thaJeztah mentioned this pull request May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants