INNER CODE UNIT · Go
Execute
corneliusweig/rakkess · cmd/root.go:141
func Execute() error {
rootCmd.SetOutput(opts.Streams.Out)
return rootCmd.Execute()
}
func init() {
klog.InitFlags(flag.CommandLine)
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
AddRakkessFlags(rootCmd)
rootCmd.Flags().StringVar(&opts.AsServiceAccount, constants.FlagServiceAccount, "", "similar to --as, but impersonate as service-account. The argument must be qualified <namespace>:<sa-name> or be combined with the --namespace option. Takes precedence over --as.")
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
opts.ExpandVerbs()
}
rootCmd.PreRunE = func(cmd *cobra.Command, args []string) error {
return opts.ExpandServiceAccount()
}