Skip to content

Commit 43a2fcf

Browse files
authored
Merge pull request docker#5880 from thaJeztah/registry_decouple_trust
cli/registry/client: remove dependency on trust / notary
2 parents 076ec3b + e3da0cc commit 43a2fcf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cli/registry/client/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"github.com/distribution/reference"
1010
manifesttypes "github.com/docker/cli/cli/manifest/types"
11-
"github.com/docker/cli/cli/trust"
1211
"github.com/docker/distribution"
1312
distributionclient "github.com/docker/distribution/registry/client"
1413
registrytypes "github.com/docker/docker/api/types/registry"
@@ -78,7 +77,7 @@ func (c *client) MountBlob(ctx context.Context, sourceRef reference.Canonical, t
7877
if err != nil {
7978
return err
8079
}
81-
repoEndpoint.actions = trust.ActionsPushAndPull
80+
repoEndpoint.actions = []string{"pull", "push"}
8281
repo, err := c.getRepositoryForReference(ctx, targetRef, repoEndpoint)
8382
if err != nil {
8483
return err
@@ -104,7 +103,7 @@ func (c *client) PutManifest(ctx context.Context, ref reference.Named, manifest
104103
return "", err
105104
}
106105

107-
repoEndpoint.actions = trust.ActionsPushAndPull
106+
repoEndpoint.actions = []string{"pull", "push"}
108107
repo, err := c.getRepositoryForReference(ctx, ref, repoEndpoint)
109108
if err != nil {
110109
return "", err

cli/registry/client/endpoint.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
"github.com/distribution/reference"
9-
"github.com/docker/cli/cli/trust"
109
"github.com/docker/distribution/registry/client/auth"
1110
"github.com/docker/distribution/registry/client/transport"
1211
registrytypes "github.com/docker/docker/api/types/registry"
@@ -94,7 +93,7 @@ func getHTTPTransport(authConfig registrytypes.AuthConfig, endpoint registry.API
9493
modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, passThruTokenHandler))
9594
} else {
9695
if len(actions) == 0 {
97-
actions = trust.ActionsPullOnly
96+
actions = []string{"pull"}
9897
}
9998
creds := registry.NewStaticCredentialStore(&authConfig)
10099
tokenHandler := auth.NewTokenHandler(authTransport, creds, repoName, actions...)

0 commit comments

Comments
 (0)