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-09 15:36:12 +02:00
parent 623356001f
commit 5d37acddeb
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 7 deletions

View File

@ -33,7 +33,7 @@ Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
Context: {{.Context}} Context: {{.Context}}
{{- end}} {{- end}}
{{- if .ServerOK}}{{with .Server}} {{- if ne .Server nil}}{{with .Server}}
Server:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}} Server:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
{{- range $component := .Components}} {{- range $component := .Components}}
@ -80,12 +80,6 @@ type clientVersion struct {
Context string 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` // NewVersionCommand creates a new cobra.Command for `docker version`
func NewVersionCommand(dockerCli command.Cli) *cobra.Command { func NewVersionCommand(dockerCli command.Cli) *cobra.Command {
var opts versionOptions var opts versionOptions