-
Notifications
You must be signed in to change notification settings - Fork 25
/
auth.go
41 lines (31 loc) · 907 Bytes
/
auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package auth
import (
"github.com/spf13/cobra"
"github.com/vmware-tanzu/sources-for-knative/plugins/vsphere/pkg"
"github.com/vmware-tanzu/sources-for-knative/plugins/vsphere/pkg/command"
)
type Options struct {
command.GenericOptions
Username string
Password string
PasswordStdIn bool
VerifyURL string
Insecure bool
}
func NewAuthCommand(clients *pkg.Clients) *cobra.Command {
options := Options{}
result := cobra.Command{
Use: "auth",
Short: "Manage vSphere credentials",
Long: "Manage vSphere credentials",
}
flags := result.PersistentFlags()
flags.StringVarP(&options.Namespace, "namespace", "n", "", "namespace to use (default namespace if omitted)")
result.AddCommand(NewCreateCommand(clients, &options))
result.AddCommand(NewDeleteCommand(clients, &options))
return &result
}