|
@@ -19,6 +19,7 @@ import (
|
|
type pluginOptions struct {
|
|
type pluginOptions struct {
|
|
name string
|
|
name string
|
|
grantPerms bool
|
|
grantPerms bool
|
|
|
|
+ disable bool
|
|
}
|
|
}
|
|
|
|
|
|
func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
@@ -35,6 +36,7 @@ func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
|
|
|
|
flags := cmd.Flags()
|
|
flags := cmd.Flags()
|
|
flags.BoolVar(&options.grantPerms, "grant-all-permissions", true, "grant all permissions necessary to run the plugin")
|
|
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
|
|
return cmd
|
|
}
|
|
}
|
|
@@ -62,10 +64,9 @@ func runInstall(dockerCli *client.DockerCli, opts pluginOptions) error {
|
|
|
|
|
|
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "plugin install")
|
|
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "plugin install")
|
|
|
|
|
|
- // TODO: pass acceptAllPermissions and noEnable flag
|
|
|
|
options := types.PluginInstallOptions{
|
|
options := types.PluginInstallOptions{
|
|
RegistryAuth: encodedAuth,
|
|
RegistryAuth: encodedAuth,
|
|
- Disabled: false,
|
|
|
|
|
|
+ Disabled: opts.disable,
|
|
AcceptAllPermissions: opts.grantPerms,
|
|
AcceptAllPermissions: opts.grantPerms,
|
|
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name),
|
|
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name),
|
|
PrivilegeFunc: requestPrivilege,
|
|
PrivilegeFunc: requestPrivilege,
|