mirror of
https://github.com/docker/cli.git
synced 2026-09-24 15:30:10 -05:00
Add disable flag for plugin Install.
Signed-off-by: Anusha Ragunathan <anusha@docker.com> Upstream-commit: 22e781e8e3ae1d1ab62ddcda983cabfde2e08ad4 Component: engine
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
type pluginOptions struct {
|
||||
name string
|
||||
grantPerms bool
|
||||
disable bool
|
||||
}
|
||||
|
||||
func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
|
||||
@@ -35,6 +36,7 @@ func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
|
||||
|
||||
flags := cmd.Flags()
|
||||
flags.BoolVar(&options.grantPerms, "grant-all-permissions", true, "grant all permissions necessary to run the plugin")
|
||||
flags.BoolVar(&options.disable, "disable", false, "do not enable the plugin on install")
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -62,10 +64,9 @@ func runInstall(dockerCli *client.DockerCli, opts pluginOptions) error {
|
||||
|
||||
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "plugin install")
|
||||
|
||||
// TODO: pass acceptAllPermissions and noEnable flag
|
||||
options := types.PluginInstallOptions{
|
||||
RegistryAuth: encodedAuth,
|
||||
Disabled: false,
|
||||
Disabled: opts.disable,
|
||||
AcceptAllPermissions: opts.grantPerms,
|
||||
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name),
|
||||
PrivilegeFunc: requestPrivilege,
|
||||
|
||||
Reference in New Issue
Block a user