Skip to content

Commit 1a80524

Browse files
authored
Merge pull request #6502 from thaJeztah/rm_deprecated
cli/command: remove deprecated methods and options
2 parents d719b41 + 782deff commit 1a80524

File tree

3 files changed

+0
-77
lines changed

3 files changed

+0
-77
lines changed

cli/command/cli.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ type DockerCli struct {
6767
err *streams.Out
6868
client client.APIClient
6969
serverInfo ServerInfo
70-
contentTrust bool
7170
contextStore store.Store
7271
currentContext string
7372
init sync.Once
@@ -86,13 +85,6 @@ type DockerCli struct {
8685
enableGlobalMeter, enableGlobalTracer bool
8786
}
8887

89-
// DefaultVersion returns [client.MaxAPIVersion].
90-
//
91-
// Deprecated: this function is no longer used and will be removed in the next release.
92-
func (*DockerCli) DefaultVersion() string {
93-
return client.MaxAPIVersion
94-
}
95-
9688
// CurrentVersion returns the API version currently negotiated, or the default
9789
// version otherwise.
9890
func (cli *DockerCli) CurrentVersion() string {
@@ -157,14 +149,6 @@ func (cli *DockerCli) ServerInfo() ServerInfo {
157149
return cli.serverInfo
158150
}
159151

160-
// ContentTrustEnabled returns whether content trust has been enabled by an
161-
// environment variable.
162-
//
163-
// Deprecated: check the value of the DOCKER_CONTENT_TRUST environment variable to detect whether content-trust is enabled.
164-
func (cli *DockerCli) ContentTrustEnabled() bool {
165-
return cli.contentTrust
166-
}
167-
168152
// BuildKitEnabled returns buildkit is enabled or not.
169153
func (cli *DockerCli) BuildKitEnabled() (bool, error) {
170154
// use DOCKER_BUILDKIT env var value if set and not empty
@@ -601,7 +585,6 @@ type ServerInfo struct {
601585
// environment.
602586
func NewDockerCli(ops ...CLIOption) (*DockerCli, error) {
603587
defaultOps := []CLIOption{
604-
withContentTrustFromEnv(),
605588
WithDefaultContextStoreConfig(),
606589
WithStandardStreams(),
607590
WithUserAgent(UserAgent()),

cli/command/cli_options.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"io"
99
"net/http"
1010
"os"
11-
"strconv"
1211
"strings"
1312

1413
"github.com/docker/cli/cli/streams"
@@ -76,37 +75,6 @@ func WithErrorStream(err io.Writer) CLIOption {
7675
}
7776
}
7877

79-
// withContentTrustFromEnv enables content trust on a cli from environment variable DOCKER_CONTENT_TRUST value.
80-
func withContentTrustFromEnv() CLIOption {
81-
return func(cli *DockerCli) error {
82-
cli.contentTrust = false
83-
if e := os.Getenv("DOCKER_CONTENT_TRUST"); e != "" {
84-
if t, err := strconv.ParseBool(e); t || err != nil {
85-
// treat any other value as true
86-
cli.contentTrust = true
87-
}
88-
}
89-
return nil
90-
}
91-
}
92-
93-
// WithContentTrustFromEnv enables content trust on a cli from environment variable DOCKER_CONTENT_TRUST value.
94-
//
95-
// Deprecated: this option is no longer used, and will be removed in the next release.
96-
func WithContentTrustFromEnv() CLIOption {
97-
return withContentTrustFromEnv()
98-
}
99-
100-
// WithContentTrust enables content trust on a cli.
101-
//
102-
// Deprecated: this option is no longer used, and will be removed in the next release.
103-
func WithContentTrust(enabled bool) CLIOption {
104-
return func(cli *DockerCli) error {
105-
cli.contentTrust = enabled
106-
return nil
107-
}
108-
}
109-
11078
// WithDefaultContextStoreConfig configures the cli to use the default context store configuration.
11179
func WithDefaultContextStoreConfig() CLIOption {
11280
return func(cli *DockerCli) error {

cli/command/cli_options_test.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)