Merge pull request #3542 from thaJeztah/update_deprecated
update status of deprecated features for 22.04 (docs, and some code)
This commit is contained in:
@ -64,7 +64,13 @@ func NewUpdateCommand(dockerCli command.Cli) *cobra.Command {
|
||||
flags.VarP(&options.memory, "memory", "m", "Memory limit")
|
||||
flags.Var(&options.memoryReservation, "memory-reservation", "Memory soft limit")
|
||||
flags.Var(&options.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
|
||||
flags.Var(&options.kernelMemory, "kernel-memory", "Kernel memory limit")
|
||||
flags.Var(&options.kernelMemory, "kernel-memory", "Kernel memory limit (deprecated)")
|
||||
// --kernel-memory is deprecated on API v1.42 and up, but our current annotations
|
||||
// do not support only showing on < API-version. This option is no longer supported
|
||||
// by runc, so hiding it unconditionally.
|
||||
flags.SetAnnotation("kernel-memory", "deprecated", nil)
|
||||
flags.MarkHidden("kernel-memory")
|
||||
|
||||
flags.StringVar(&options.restartPolicy, "restart", "", "Restart policy to apply when a container exits")
|
||||
flags.Int64Var(&options.pidsLimit, "pids-limit", 0, "Tune container pids limit (set -1 for unlimited)")
|
||||
flags.SetAnnotation("pids-limit", "version", []string{"1.40"})
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user