Skip to content

Commit e5bce5c

Browse files
Merge pull request #6509 from thaJeztah/28.x_backport_dct_retiring
[28.x backport] trust: print deprecation warning when using hub Notary server
2 parents a69c591 + 0351ece commit e5bce5c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cli/trust/trust.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package trust
33
import (
44
"context"
55
"encoding/json"
6+
"fmt"
67
"io"
78
"net"
89
"net/http"
@@ -107,6 +108,11 @@ func (scs simpleCredentialStore) RefreshToken(*url.URL, string) string {
107108

108109
func (simpleCredentialStore) SetRefreshToken(*url.URL, string, string) {}
109110

111+
const dctDeprecation = `WARNING: Docker is retiring DCT for Docker Official Images (DOI).
112+
For details, refer to https://docs.docker.com/go/dct-deprecation/
113+
114+
`
115+
110116
// GetNotaryRepository returns a NotaryRepository which stores all the
111117
// information needed to operate on a notary repository.
112118
// It creates an HTTP transport providing authentication support.
@@ -115,6 +121,9 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo
115121
if err != nil {
116122
return nil, err
117123
}
124+
if server == NotaryServer {
125+
_, _ = fmt.Fprint(os.Stderr, dctDeprecation)
126+
}
118127

119128
cfg := tlsconfig.ClientDefault()
120129
cfg.InsecureSkipVerify = !repoInfo.Index.Secure

0 commit comments

Comments
 (0)