Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for NamespaceOrDefault (0.23 sec)

  1. istioctl/pkg/cli/context.go

    	Namespace() string
    	// IstioNamespace returns the Istio namespace specified by the user
    	IstioNamespace() string
    	// NamespaceOrDefault returns the namespace specified by the user, or the default namespace if none was specified
    	NamespaceOrDefault(namespace string) string
    }
    
    type instance struct {
    	// clients are cached clients for each revision
    	clients map[string]kube.CLIClient
    	RootFlags
    }
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  2. istioctl/pkg/waypoint/waypoint.go

    	enrollNamespace bool
    )
    
    const waitTimeout = 90 * time.Second
    
    func Cmd(ctx cli.Context) *cobra.Command {
    	makeGateway := func(forApply bool) (*gateway.Gateway, error) {
    		ns := ctx.NamespaceOrDefault(ctx.Namespace())
    		if ctx.Namespace() == "" && !forApply {
    			ns = ""
    		}
    		// If a user sets the waypoint name to an empty string, set it to the default namespace waypoint name.
    		if waypointName == "" {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Apr 22 20:20:40 GMT 2024
    - 15K bytes
    - Viewed (0)
  3. istioctl/pkg/completion/completion.go

    	"istio.io/istio/pkg/kube"
    )
    
    func getPodsNameInDefaultNamespace(ctx cli.Context, toComplete string) ([]string, error) {
    	client, err := ctx.CLIClient()
    	if err != nil {
    		return nil, err
    	}
    	ns := ctx.NamespaceOrDefault(ctx.Namespace())
    	podList, err := client.Kube().CoreV1().Pods(ns).List(context.Background(), metav1.ListOptions{})
    	if err != nil {
    		return nil, err
    	}
    
    	var podsName []string
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  4. istioctl/pkg/dashboard/dashboard.go

    			if err != nil {
    				return fmt.Errorf("failed to create k8s client: %v", err)
    			}
    
    			var podName, ns string
    			if labelSelector != "" {
    				pl, err := kubeClient.PodsForSelector(context.TODO(), ctx.NamespaceOrDefault(ctx.Namespace()), labelSelector)
    				if err != nil {
    					return fmt.Errorf("not able to locate pod with selector %s: %v", labelSelector, err)
    				}
    
    				if len(pl.Items) < 1 {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Apr 15 01:29:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  5. istioctl/pkg/checkinject/checkinject.go

    				if err != nil {
    					return err
    				}
    				podLabels = pod.GetLabels()
    				nsLabels = ns.GetLabels()
    			} else {
    				namespace := ctx.NamespaceOrDefault(ctx.Namespace())
    				ns, err := kubeClient.Kube().CoreV1().Namespaces().Get(context.TODO(), namespace, metav1.GetOptions{})
    				if err != nil {
    					return err
    				}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  6. istioctl/pkg/describe/describe.go

    		RunE: func(cmd *cobra.Command, args []string) error {
    			describeNamespace = ctx.NamespaceOrDefault(ctx.Namespace())
    			if len(args) != 1 {
    				return fmt.Errorf("expecting pod name")
    			}
    
    			podName, ns := handlers.InferPodInfo(args[0], ctx.NamespaceOrDefault(""))
    
    			client, err := ctx.CLIClient()
    			if err != nil {
    				return err
    			}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 50.4K bytes
    - Viewed (0)
  7. istioctl/pkg/admin/istiodconfig.go

    				} else {
    					istiodLabelSelector = fmt.Sprintf("%s=%s", label.IoIstioRev.Name, opts.Revision)
    				}
    				pl, err := client.PodsForSelector(context.TODO(), ctx.NamespaceOrDefault(ctx.IstioNamespace()), istiodLabelSelector)
    				if err != nil {
    					return fmt.Errorf("not able to locate pod with selector %s: %v", istiodLabelSelector, err)
    				}
    
    				if len(pl.Items) < 1 {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  8. istioctl/pkg/wait/wait.go

    			}
    		},
    		Args: func(cmd *cobra.Command, args []string) error {
    			if err := cobra.ExactArgs(2)(cmd, args); err != nil {
    				return err
    			}
    			nameflag, namespace = handlers.InferPodInfo(args[1], cliCtx.NamespaceOrDefault(namespace))
    			return validateType(args[0])
    		},
    	}
    	cmd.PersistentFlags().StringVar(&forFlag, "for", "distribution",
    		"Wait condition, must be 'distribution' or 'delete'")
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Feb 17 12:24:17 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  9. istioctl/pkg/validate/validate.go

      istioctl analyze samples/bookinfo/networking/bookinfo-gateway.yaml
    `,
    		Args: cobra.NoArgs,
    		RunE: func(c *cobra.Command, _ []string) error {
    			istioNamespace := ctx.IstioNamespace()
    			defaultNamespace := ctx.NamespaceOrDefault("")
    			return validateFiles(&istioNamespace, defaultNamespace, filenames, c.OutOrStderr())
    		},
    	}
    
    	flags := c.PersistentFlags()
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Jan 22 17:58:52 GMT 2024
    - 15K bytes
    - Viewed (0)
  10. istioctl/pkg/analyze/analyze.go

    			// for file resources that don't have one specified.
    			selectedNamespace = ctx.Namespace()
    			if useKube {
    				// apply default namespace if not specified and useKube is true
    				selectedNamespace = ctx.NamespaceOrDefault(selectedNamespace)
    				if selectedNamespace != "" {
    					client, err := ctx.CLIClient()
    					if err != nil {
    						return err
    					}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 17K bytes
    - Viewed (0)
Back to top