client: rename/deprecate WithVersion, WithVersionFromEnv

Add WithAPIVersion and WithAPIVersionFromEnv to be more clear on
the intent, and to align with other related options and fields.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-12 16:39:20 +01:00
parent e5db2380f5
commit dae3650dcc
34 changed files with 111 additions and 77 deletions

View File

@@ -53,7 +53,7 @@ func TestAPIClientVersionOldNotSupported(t *testing.T) {
assert.NilError(t, err)
vMinInt--
version := fmt.Sprintf("%s.%d", major, vMinInt)
apiClient := request.NewAPIClient(t, client.WithVersion(version))
apiClient := request.NewAPIClient(t, client.WithAPIVersion(version))
expectedErrorMessage := fmt.Sprintf("Error response from daemon: client version %s is too old. Minimum supported API version is %s, please upgrade your client to a newer version", version, minApiVersion)
_, err = apiClient.ServerVersion(ctx, client.ServerVersionOptions{})