(dockerCLI command.Cli, opts pluginOptions)
| 52 | } |
| 53 | |
| 54 | func buildPullConfig(dockerCLI command.Cli, opts pluginOptions) (client.PluginInstallOptions, error) { |
| 55 | // Names with both tag and digest will be treated by the daemon |
| 56 | // as a pull by digest with a local name for the tag |
| 57 | // (if no local name is provided). |
| 58 | ref, err := reference.ParseNormalizedNamed(opts.remote) |
| 59 | if err != nil { |
| 60 | return client.PluginInstallOptions{}, err |
| 61 | } |
| 62 | |
| 63 | encodedAuth, err := command.RetrieveAuthTokenFromImage(dockerCLI.ConfigFile(), ref.String()) |
| 64 | if err != nil { |
| 65 | return client.PluginInstallOptions{}, err |
| 66 | } |
| 67 | |
| 68 | return client.PluginInstallOptions{ |
| 69 | RegistryAuth: encodedAuth, |
| 70 | RemoteRef: ref.String(), |
| 71 | Disabled: opts.disable, |
| 72 | AcceptAllPermissions: opts.grantPerms, |
| 73 | AcceptPermissionsFunc: acceptPrivileges(dockerCLI, opts.remote), |
| 74 | PrivilegeFunc: nil, |
| 75 | Args: opts.args, |
| 76 | }, nil |
| 77 | } |
| 78 | |
| 79 | func runInstall(ctx context.Context, dockerCLI command.Cli, opts pluginOptions) error { |
| 80 | var localName string |
no test coverage detected
searching dependent graphs…