client: ServerVersionResult: add back legacy fields

Short term solution; we need to decide whether these should be kept
or removed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-31 01:21:10 +01:00
parent d7bd5092d9
commit 3d28cb8bbd
2 changed files with 38 additions and 0 deletions

View File

@@ -17,12 +17,27 @@ type ServerVersionResult struct {
// Platform is the platform (product name) the server is running on.
Platform PlatformInfo
// Version is the version of the daemon.
Version string
// APIVersion is the highest API version supported by the server.
APIVersion string
// MinAPIVersion is the minimum API version the server supports.
MinAPIVersion string
// Os is the operating system the server runs on.
Os string
// Arch is the hardware architecture the server runs on.
Arch string
// Experimental indicates that the daemon runs with experimental
// features enabled.
//
// Deprecated: this field will be removed in the next version.
Experimental bool
// Components contains version information for the components making
// up the server. Information in this field is for informational
// purposes, and not part of the API contract.
@@ -55,8 +70,12 @@ func (cli *Client) ServerVersion(ctx context.Context, _ ServerVersionOptions) (S
Platform: PlatformInfo{
Name: v.Platform.Name,
},
Version: v.Version,
APIVersion: v.APIVersion,
MinAPIVersion: v.MinAPIVersion,
Os: v.Os,
Arch: v.Arch,
Experimental: v.Experimental, //nolint:staticcheck // ignore deprecated field.
Components: v.Components,
}, nil
}

View File

@@ -17,12 +17,27 @@ type ServerVersionResult struct {
// Platform is the platform (product name) the server is running on.
Platform PlatformInfo
// Version is the version of the daemon.
Version string
// APIVersion is the highest API version supported by the server.
APIVersion string
// MinAPIVersion is the minimum API version the server supports.
MinAPIVersion string
// Os is the operating system the server runs on.
Os string
// Arch is the hardware architecture the server runs on.
Arch string
// Experimental indicates that the daemon runs with experimental
// features enabled.
//
// Deprecated: this field will be removed in the next version.
Experimental bool
// Components contains version information for the components making
// up the server. Information in this field is for informational
// purposes, and not part of the API contract.
@@ -55,8 +70,12 @@ func (cli *Client) ServerVersion(ctx context.Context, _ ServerVersionOptions) (S
Platform: PlatformInfo{
Name: v.Platform.Name,
},
Version: v.Version,
APIVersion: v.APIVersion,
MinAPIVersion: v.MinAPIVersion,
Os: v.Os,
Arch: v.Arch,
Experimental: v.Experimental, //nolint:staticcheck // ignore deprecated field.
Components: v.Components,
}, nil
}