mirror of https://github.com/docker/cli.git
cli/command/system: remove printStorageDriverWarnings()
These warnings were for features that are no longer supported (overlay on a backingFS without d_type support), or related to the deprecated devicemapper storage driver. Removing this function for that reason. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f3a6e7eded
commit
51aa683a88
|
@ -426,7 +426,6 @@ func printServerWarnings(dockerCli command.Cli, info types.Info) {
|
|||
return
|
||||
}
|
||||
// daemon didn't return warnings. Fallback to old behavior
|
||||
printStorageDriverWarnings(dockerCli, info)
|
||||
printServerWarningsLegacy(dockerCli, info)
|
||||
}
|
||||
|
||||
|
@ -494,51 +493,6 @@ func printServerWarningsLegacy(dockerCli command.Cli, info types.Info) {
|
|||
}
|
||||
}
|
||||
|
||||
// printStorageDriverWarnings generates warnings based on storage-driver information
|
||||
// returned by the daemon.
|
||||
// DEPRECATED: warnings are now generated by the daemon, and returned in
|
||||
// info.Warnings. This function is used to provide backward compatibility with
|
||||
// daemons that do not provide these warnings. No new warnings should be added
|
||||
// here.
|
||||
func printStorageDriverWarnings(dockerCli command.Cli, info types.Info) {
|
||||
if info.OSType == "windows" {
|
||||
return
|
||||
}
|
||||
if info.DriverStatus == nil {
|
||||
return
|
||||
}
|
||||
for _, pair := range info.DriverStatus {
|
||||
if pair[0] == "Data loop file" {
|
||||
fmt.Fprintf(dockerCli.Err(), "WARNING: %s: usage of loopback devices is "+
|
||||
"strongly discouraged for production use.\n "+
|
||||
"Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.\n", info.Driver)
|
||||
}
|
||||
if pair[0] == "Supports d_type" && pair[1] == "false" {
|
||||
backingFs := getBackingFs(info)
|
||||
|
||||
msg := fmt.Sprintf("WARNING: %s: the backing %s filesystem is formatted without d_type support, which leads to incorrect behavior.\n", info.Driver, backingFs)
|
||||
if backingFs == "xfs" {
|
||||
msg += " Reformat the filesystem with ftype=1 to enable d_type support.\n"
|
||||
}
|
||||
msg += " Running without d_type support will not be supported in future releases."
|
||||
fmt.Fprintln(dockerCli.Err(), msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getBackingFs(info types.Info) string {
|
||||
if info.DriverStatus == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, pair := range info.DriverStatus {
|
||||
if pair[0] == "Backing Filesystem" {
|
||||
return pair[1]
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func formatInfo(dockerCli command.Cli, info info, format string) error {
|
||||
// Ensure slice/array fields render as `[]` not `null`
|
||||
if info.ClientInfo != nil && info.ClientInfo.Plugins == nil {
|
||||
|
|
Loading…
Reference in New Issue