-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
login.go
33 lines (26 loc) · 1.18 KB
/
login.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
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/waypoint_completer/cmd/action"
"github.com/spf13/cobra"
)
var loginCmd = &cobra.Command{
Use: "login",
Short: "Log in to a Waypoint server",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(loginCmd).Standalone()
loginCmd.Flags().String("auth-method", "", "Auth method to use for login.")
loginCmd.Flags().Bool("from-kubernetes", false, "Perform the initial authentication after Waypoint is installed to Kubernetes.")
loginCmd.Flags().String("from-kubernetes-namespace", "", "The name of the Kubernetes namespace that has the Waypoint token.")
loginCmd.Flags().String("from-kubernetes-secret", "", "The name of the Kubernetes secret that has the Waypoint token.")
loginCmd.Flags().String("from-kubernetes-service", "", "The name of the Kubernetes service to get the server address from.")
loginCmd.Flags().String("token", "", "Auth with a token.")
addGlobalOptions(loginCmd)
addConnectionOptions(loginCmd)
rootCmd.AddCommand(loginCmd)
carapace.Gen(loginCmd).FlagCompletion(carapace.ActionMap{
"auth-method": action.ActionAuthMethods(),
})
}