Skip to content

Commit e25843b

Browse files
committed
cli/command: remove deprecated WithContentTrustFromEnv, WithContentTrust
These options were used internally as defaults for the constructor and only impact commands implemented in the CLI itself. They were deprecated in 40cdfc0, which was included in the 28.5.0 release, so removing it for 29.0 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 592afa8 commit e25843b

File tree

3 files changed

+0
-62
lines changed

3 files changed

+0
-62
lines changed

cli/command/cli.go

Lines changed: 0 additions & 2 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
@@ -593,7 +592,6 @@ type ServerInfo struct {
593592
// environment.
594593
func NewDockerCli(ops ...CLIOption) (*DockerCli, error) {
595594
defaultOps := []CLIOption{
596-
withContentTrustFromEnv(),
597595
WithDefaultContextStoreConfig(),
598596
WithStandardStreams(),
599597
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)