Merge pull request #6509 from thaJeztah/28.x_backport_dct_retiring
[28.x backport] trust: print deprecation warning when using hub Notary server
This commit is contained in:
@@ -3,6 +3,7 @@ package trust
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -107,6 +108,11 @@ func (scs simpleCredentialStore) RefreshToken(*url.URL, string) string {
|
||||
|
||||
func (simpleCredentialStore) SetRefreshToken(*url.URL, string, string) {}
|
||||
|
||||
const dctDeprecation = `WARNING: Docker is retiring DCT for Docker Official Images (DOI).
|
||||
For details, refer to https://docs.docker.com/go/dct-deprecation/
|
||||
|
||||
`
|
||||
|
||||
// GetNotaryRepository returns a NotaryRepository which stores all the
|
||||
// information needed to operate on a notary repository.
|
||||
// It creates an HTTP transport providing authentication support.
|
||||
@@ -115,6 +121,9 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if server == NotaryServer {
|
||||
_, _ = fmt.Fprint(os.Stderr, dctDeprecation)
|
||||
}
|
||||
|
||||
cfg := tlsconfig.ClientDefault()
|
||||
cfg.InsecureSkipVerify = !repoInfo.Index.Secure
|
||||
|
||||
Reference in New Issue
Block a user