create_ingress.go 574 B

123456789101112131415161718192021
  1. package node
  2. import (
  3. "github.com/gravitl/netmaker/cli/functions"
  4. "github.com/spf13/cobra"
  5. )
  6. var nodeCreateIngressCmd = &cobra.Command{
  7. Use: "create_ingress [NETWORK NAME] [NODE ID]",
  8. Args: cobra.ExactArgs(2),
  9. Short: "Turn a Node into a Ingress",
  10. Long: `Turn a Node into a Ingress`,
  11. Run: func(cmd *cobra.Command, args []string) {
  12. functions.PrettyPrint(functions.CreateIngress(args[0], args[1], failover))
  13. },
  14. }
  15. func init() {
  16. nodeCreateIngressCmd.Flags().BoolVar(&failover, "failover", false, "Enable FailOver ?")
  17. rootCmd.AddCommand(nodeCreateIngressCmd)
  18. }