mirror of https://github.com/docker/cli.git
support settings in docker plugins install
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
6780c318a3
commit
41513e3051
|
@ -18,16 +18,20 @@ type pluginOptions struct {
|
|||
name string
|
||||
grantPerms bool
|
||||
disable bool
|
||||
args []string
|
||||
}
|
||||
|
||||
func newInstallCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
var options pluginOptions
|
||||
cmd := &cobra.Command{
|
||||
Use: "install [OPTIONS] PLUGIN",
|
||||
Use: "install [OPTIONS] PLUGIN [KEY=VALUE...]",
|
||||
Short: "Install a plugin",
|
||||
Args: cli.ExactArgs(1), // TODO: allow for set args
|
||||
Args: cli.RequiresMinArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
options.name = args[0]
|
||||
if len(args) > 1 {
|
||||
options.args = args[1:]
|
||||
}
|
||||
return runInstall(dockerCli, options)
|
||||
},
|
||||
}
|
||||
|
@ -75,6 +79,7 @@ func runInstall(dockerCli *command.DockerCli, opts pluginOptions) error {
|
|||
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name),
|
||||
// TODO: Rename PrivilegeFunc, it has nothing to do with privileges
|
||||
PrivilegeFunc: registryAuthFunc,
|
||||
Args: opts.args,
|
||||
}
|
||||
if err := dockerCli.Client().PluginInstall(ctx, ref.String(), options); err != nil {
|
||||
return err
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
func newSetCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "set PLUGIN key1=value1 [key2=value2...]",
|
||||
Use: "set PLUGIN KEY=VALUE [KEY=VALUE...]",
|
||||
Short: "Change settings for a plugin",
|
||||
Args: cli.RequiresMinArgs(2),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
|
Loading…
Reference in New Issue