Only read trust setting from options

Rename IsTrusted to ContentTrustEnabled

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin
2018-03-08 14:56:56 -05:00
parent 6e21829af4
commit feae0e9756
13 changed files with 48 additions and 49 deletions

View File

@ -29,7 +29,7 @@ type pluginOptions struct {
func loadPullFlags(dockerCli command.Cli, opts *pluginOptions, flags *pflag.FlagSet) {
flags.BoolVar(&opts.grantPerms, "grant-all-permissions", false, "Grant all permissions necessary to run the plugin")
command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.IsTrusted())
command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
}
func newInstallCommand(dockerCli command.Cli) *cobra.Command {
@ -91,7 +91,7 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
remote := ref.String()
_, isCanonical := ref.(reference.Canonical)
if !opts.untrusted && dockerCli.IsTrusted() && !isCanonical {
if !opts.untrusted && !isCanonical {
ref = reference.TagNameOnly(ref)
nt, ok := ref.(reference.NamedTagged)
if !ok {

View File

@ -32,7 +32,7 @@ func newPushCommand(dockerCli command.Cli) *cobra.Command {
flags := cmd.Flags()
command.AddTrustSigningFlags(flags, &opts.untrusted, dockerCli.IsTrusted())
command.AddTrustSigningFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
return cmd
}
@ -67,7 +67,7 @@ func runPush(dockerCli command.Cli, opts pushOptions) error {
}
defer responseBody.Close()
if !opts.untrusted && dockerCli.IsTrusted() {
if !opts.untrusted {
repoInfo.Class = "plugin"
return image.PushTrustedReference(dockerCli, repoInfo, named, authConfig, responseBody)
}