Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for GetRootCmd (0.25 sec)

  1. istioctl/cmd/istioctl_test.go

    	// unknown flags should be a command parse
    	rootCmd := GetRootCmd([]string{"--unknown-flag"})
    	fErr := rootCmd.Execute()
    
    	switch fErr.(type) {
    	case istioctlutil.CommandParseError:
    		// do nothing
    	default:
    		t.Errorf("Expected a CommandParseError, but got %q.", fErr)
    	}
    
    	// we should propagate to subcommands
    	rootCmd = GetRootCmd([]string{"analyze", "--unknown-flag"})
    	fErr = rootCmd.Execute()
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Aug 29 14:53:25 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  2. istioctl/cmd/istioctl/main.go

    )
    
    func main() {
    	if err := cmd.ConfigAndEnvProcessing(); err != nil {
    		fmt.Fprintf(os.Stderr, "Could not initialize: %v\n", err)
    		exitCode := cmd.GetExitCode(err)
    		os.Exit(exitCode)
    	}
    
    	rootCmd := cmd.GetRootCmd(os.Args[1:])
    
    	log.EnableKlogWithCobra()
    
    	if err := rootCmd.Execute(); err != nil {
    		exitCode := cmd.GetExitCode(err)
    		os.Exit(exitCode)
    	}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue May 23 17:08:31 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  3. operator/cmd/mesh/root.go

    }
    
    func addFlags(cmd *cobra.Command, rootArgs *RootArgs) {
    	cmd.PersistentFlags().BoolVarP(&rootArgs.DryRun, "dry-run", "",
    		false, "Console/log output only, make no changes.")
    }
    
    // GetRootCmd returns the root of the cobra command-tree.
    func GetRootCmd(ctx cli.Context, args []string) *cobra.Command {
    	rootCmd := &cobra.Command{
    		Use:          "mesh",
    		Short:        "Command line Istio install utility.",
    		SilenceUsage: true,
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 01:18:49 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  4. operator/cmd/mesh.go

    	"istio.io/istio/operator/cmd/mesh"
    	binversion "istio.io/istio/operator/version"
    	"istio.io/istio/pkg/version"
    )
    
    func main() {
    	version.Info.Version = binversion.OperatorVersionString
    	rootCmd := mesh.GetRootCmd(cli.NewCLIContext(nil), os.Args[1:])
    	if err := rootCmd.Execute(); err != nil {
    		os.Exit(1)
    	}
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Aug 29 14:15:33 GMT 2023
    - 963 bytes
    - Viewed (0)
  5. operator/cmd/mesh/profile-list_test.go

    	g := NewWithT(t)
    	args := []string{"profile", "list", "--dry-run", "--manifests", filepath.Join(env.IstioSrc, "manifests")}
    
    	kubeClientFunc = func() (kube.CLIClient, error) {
    		return nil, nil
    	}
    	rootCmd := GetRootCmd(cli.NewFakeContext(&cli.NewFakeContextOption{
    		Version: "25",
    	}), args)
    	var out bytes.Buffer
    	rootCmd.SetOut(&out)
    	rootCmd.SetErr(&out)
    
    	err := rootCmd.Execute()
    	if err != nil {
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  6. operator/cmd/mesh/operator_test.go

    			if test.watchedNamespaces != "" {
    				args = append(args, "--watchedNamespaces", test.watchedNamespaces)
    			}
    
    			kubeClientFunc = func() (kube.CLIClient, error) {
    				return nil, nil
    			}
    			rootCmd := GetRootCmd(cli.NewFakeContext(&cli.NewFakeContextOption{
    				Version: "25",
    			}), args)
    			err := rootCmd.Execute()
    			assert.NoError(t, err)
    
    			readActions := map[string]bool{
    				"get":   true,
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Aug 29 14:15:33 GMT 2023
    - 6.4K bytes
    - Viewed (0)
  7. istioctl/cmd/options_test.go

          --log_target: The set of paths where to output the log. This can be any path as well as the special values stdout and stderr
    `
    
    func TestLogHelp(t *testing.T) {
    	var out bytes.Buffer
    	rootCmd := GetRootCmd([]string{"options"})
    	rootCmd.SetOut(&out)
    	rootCmd.SetErr(&out)
    
    	fErr := rootCmd.Execute()
    	if fErr != nil {
    		t.Fatalf("options failed with %v and %q\n", fErr, out.String())
    	}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Sep 14 02:38:54 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  8. istioctl/cmd/root.go

    		return err
    	}
    
    	return nil
    }
    
    func init() {
    	viper.SetDefault("istioNamespace", constants.IstioSystemNamespace)
    	viper.SetDefault("xds-port", 15012)
    }
    
    // GetRootCmd returns the root of the cobra command-tree.
    func GetRootCmd(args []string) *cobra.Command {
    	rootCmd := &cobra.Command{
    		Use:               "istioctl",
    		Short:             "Istio control interface.",
    		SilenceUsage:      true,
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Apr 11 20:51:30 GMT 2024
    - 10K bytes
    - Viewed (0)
  9. operator/cmd/mesh/manifest_shared_test.go

    	return runCommand(args)
    }
    
    // runCommand runs the given command string.
    func runCommand(command string) (string, error) {
    	var out bytes.Buffer
    	rootCmd := GetRootCmd(cli.NewFakeContext(&cli.NewFakeContextOption{
    		Version: "25",
    	}), strings.Split(command, " "))
    	rootCmd.SetOut(&out)
    
    	err := rootCmd.Execute()
    	return out.String(), err
    }
    
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (0)
Back to top