These fields were deprecated in ff191c58f76d1210485db6b50fac50d723f5f7ce,
and are now omitted.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -116,11 +116,13 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht |
| 116 | 116 |
info.FirewallBackend = nil |
| 117 | 117 |
} |
| 118 | 118 |
|
| 119 |
- // TODO(thaJeztah): Expected commits are deprecated, and should no longer be set in API 1.49. |
|
| 120 |
- info.ContainerdCommit.Expected = info.ContainerdCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 121 |
- info.RuncCommit.Expected = info.RuncCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 122 |
- info.InitCommit.Expected = info.InitCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 123 |
- |
|
| 119 |
+ if versions.LessThan(version, "1.49") {
|
|
| 120 |
+ // Expected commits are omitted in API 1.49, but should still be |
|
| 121 |
+ // included in older versions. |
|
| 122 |
+ info.ContainerdCommit.Expected = info.ContainerdCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 123 |
+ info.RuncCommit.Expected = info.RuncCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 124 |
+ info.InitCommit.Expected = info.InitCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 125 |
+ } |
|
| 124 | 126 |
if versions.GreaterThanOrEqualTo(version, "1.42") {
|
| 125 | 127 |
info.KernelMemory = false |
| 126 | 128 |
} |
| ... | ... |
@@ -7186,13 +7186,6 @@ definitions: |
| 7186 | 7186 |
description: "Actual commit ID of external tool." |
| 7187 | 7187 |
type: "string" |
| 7188 | 7188 |
example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" |
| 7189 |
- Expected: |
|
| 7190 |
- description: | |
|
| 7191 |
- Commit ID of external tool expected by dockerd as set at build time. |
|
| 7192 |
- |
|
| 7193 |
- **Deprecated**: This field is deprecated and will be omitted in a API v1.49. |
|
| 7194 |
- type: "string" |
|
| 7195 |
- example: "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" |
|
| 7196 | 7189 |
|
| 7197 | 7190 |
SwarmInfo: |
| 7198 | 7191 |
description: | |
| ... | ... |
@@ -144,7 +144,7 @@ type Commit struct {
|
| 144 | 144 |
// Expected is the commit ID of external tool expected by dockerd as set at build time. |
| 145 | 145 |
// |
| 146 | 146 |
// Deprecated: this field is no longer used in API v1.49, but kept for backward-compatibility with older API versions. |
| 147 |
- Expected string |
|
| 147 |
+ Expected string `json:",omitempty"` |
|
| 148 | 148 |
} |
| 149 | 149 |
|
| 150 | 150 |
// NetworkAddressPool is a temp struct used by [Info] struct. |
| ... | ... |
@@ -26,6 +26,9 @@ keywords: "API, Docker, rcli, REST, documentation" |
| 26 | 26 |
* Deprecated: The `AllowNondistributableArtifactsCIDRs` and `AllowNondistributableArtifactsHostnames` |
| 27 | 27 |
fields in the `RegistryConfig` struct in the `GET /info` response are omitted |
| 28 | 28 |
in API v1.49. |
| 29 |
+* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and |
|
| 30 |
+ `InitCommit.Expected` fields in the `GET /info` endpoint were deprecated |
|
| 31 |
+ in API v1.48, and are now omitted in API v1.49. |
|
| 29 | 32 |
|
| 30 | 33 |
## v1.48 API changes |
| 31 | 34 |
|
| ... | ... |
@@ -5,23 +5,45 @@ package system // import "github.com/docker/docker/integration/system" |
| 5 | 5 |
import ( |
| 6 | 6 |
"testing" |
| 7 | 7 |
|
| 8 |
+ "github.com/docker/docker/client" |
|
| 8 | 9 |
"gotest.tools/v3/assert" |
| 9 | 10 |
is "gotest.tools/v3/assert/cmp" |
| 10 | 11 |
) |
| 11 | 12 |
|
| 12 | 13 |
func TestInfoBinaryCommits(t *testing.T) {
|
| 13 | 14 |
ctx := setupTest(t) |
| 14 |
- apiClient := testEnv.APIClient() |
|
| 15 | 15 |
|
| 16 |
- info, err := apiClient.Info(ctx) |
|
| 17 |
- assert.NilError(t, err) |
|
| 16 |
+ t.Run("current", func(t *testing.T) {
|
|
| 17 |
+ apiClient := testEnv.APIClient() |
|
| 18 | 18 |
|
| 19 |
- assert.Check(t, "N/A" != info.ContainerdCommit.ID) |
|
| 20 |
- assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 19 |
+ info, err := apiClient.Info(ctx) |
|
| 20 |
+ assert.NilError(t, err) |
|
| 21 | 21 |
|
| 22 |
- assert.Check(t, "N/A" != info.InitCommit.ID) |
|
| 23 |
- assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 22 |
+ assert.Check(t, "N/A" != info.ContainerdCommit.ID) |
|
| 23 |
+ assert.Check(t, is.Equal(info.ContainerdCommit.Expected, "")) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 24 | 24 |
|
| 25 |
- assert.Check(t, "N/A" != info.RuncCommit.ID) |
|
| 26 |
- assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 25 |
+ assert.Check(t, "N/A" != info.InitCommit.ID) |
|
| 26 |
+ assert.Check(t, is.Equal(info.InitCommit.Expected, "")) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 27 |
+ |
|
| 28 |
+ assert.Check(t, "N/A" != info.RuncCommit.ID) |
|
| 29 |
+ assert.Check(t, is.Equal(info.RuncCommit.Expected, "")) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 30 |
+ }) |
|
| 31 |
+ |
|
| 32 |
+ // Expected commits are omitted in API 1.49, but should still be included in older versions. |
|
| 33 |
+ t.Run("1.48", func(t *testing.T) {
|
|
| 34 |
+ apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.48"))
|
|
| 35 |
+ assert.NilError(t, err) |
|
| 36 |
+ |
|
| 37 |
+ info, err := apiClient.Info(ctx) |
|
| 38 |
+ assert.NilError(t, err) |
|
| 39 |
+ |
|
| 40 |
+ assert.Check(t, "N/A" != info.ContainerdCommit.ID) |
|
| 41 |
+ assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 42 |
+ |
|
| 43 |
+ assert.Check(t, "N/A" != info.InitCommit.ID) |
|
| 44 |
+ assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 45 |
+ |
|
| 46 |
+ assert.Check(t, "N/A" != info.RuncCommit.ID) |
|
| 47 |
+ assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. |
|
| 48 |
+ }) |
|
| 27 | 49 |
} |