cli/command/system:remove versionInfo.ServerOK() utility

It's defined on a non-exported type, and was only used in a template.
Replacing for a basic "nil" check, which should do the same.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-04-11 18:55:44 +02:00
parent 623356001f
commit 5d37acddeb
+1 -7
View File
@@ -33,7 +33,7 @@ Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
Context: {{.Context}}
{{- end}}
{{- if .ServerOK}}{{with .Server}}
{{- if ne .Server nil}}{{with .Server}}
Server:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
{{- range $component := .Components}}
@@ -80,12 +80,6 @@ type clientVersion struct {
Context string
}
// ServerOK returns true when the client could connect to the docker server
// and parse the information received. It returns false otherwise.
func (v versionInfo) ServerOK() bool {
return v.Server != nil
}
// NewVersionCommand creates a new cobra.Command for `docker version`
func NewVersionCommand(dockerCli command.Cli) *cobra.Command {
var opts versionOptions