Merge pull request #162 from foomo/feature/azure-completion

fix(azure/az): add completions
This commit is contained in:
Kevin Franklin Kim 2024-12-03 15:06:51 +01:00 committed by GitHub
commit cb17a4c194
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,11 @@ func NewCommand(l log.Logger, az *AZ, kubectl *kubectl.Kubectl, opts ...CommandO
{ {
Name: "login", Name: "login",
Description: "Log in to Azure", Description: "Log in to Azure",
Execute: inst.exec, Flags: func(ctx context.Context, r *readline.Readline, fs *readline.FlagSets) error {
fs.Default().String("tenant", "", "The Microsoft Entra tenant")
return nil
},
Execute: inst.exec,
}, },
{ {
Name: "logout", Name: "logout",
@ -81,6 +85,22 @@ func NewCommand(l log.Logger, az *AZ, kubectl *kubectl.Kubectl, opts ...CommandO
Description: "Manage Azure CLI configuration", Description: "Manage Azure CLI configuration",
Execute: inst.exec, Execute: inst.exec,
}, },
{
Name: "acr",
Description: "Manage private registries with Azure Container Registries",
Execute: inst.exec,
Nodes: tree.Nodes{
{
Name: "login",
Description: "Log in to an Azure Container Registry through the Docker CLI",
Flags: func(ctx context.Context, r *readline.Readline, fs *readline.FlagSets) error {
fs.Default().String("name", "", "The name of the container registry")
return nil
},
Execute: inst.exec,
},
},
},
{ {
Name: "kubeconfig", Name: "kubeconfig",
Description: "Retrieve credentials to access remote cluster", Description: "Retrieve credentials to access remote cluster",
@ -105,7 +125,7 @@ func NewCommand(l log.Logger, az *AZ, kubectl *kubectl.Kubectl, opts ...CommandO
}, },
}, },
Flags: func(ctx context.Context, r *readline.Readline, fs *readline.FlagSets) error { Flags: func(ctx context.Context, r *readline.Readline, fs *readline.FlagSets) error {
fs.Internal().String("profile", "", "Store credentials in given profile.") fs.Internal().String("profile", "", "Store credentials in given profile")
return fs.Internal().SetValues("profile", "azure") return fs.Internal().SetValues("profile", "azure")
}, },
Execute: inst.kubeconfig, Execute: inst.kubeconfig,