prow/flagutil/k8s_client.go
func (o *KubernetesClientOptions) Validate(dryRun bool) error {
	if dryRun && o.masterURL == "" {
		return errors.New("a dry-run was requested but required flag -masterurl was unset")
	}

	if o.masterURL != "" {
		if _, err := url.ParseRequestURI(o.masterURL); err != nil {
			return fmt.Errorf("invalid -masterurl URI: %q", o.masterURL)
		}
	}
	if o.kubeConfig != "" {
		if _, err := os.Stat(o.kubeConfig); err != nil {
			return err
		}
	}

	return nil
}
func (o *KubernetesClientOptions) Validate(dryRun bool) error {
	if dryRun && o.masterURL == "" {
		return errors.New("a dry-run was requested but required flag -masterurl was unset")
	}

	if o.masterURL != "" {
		if _, err := url.ParseRequestURI(o.masterURL); err != nil {
			return fmt.Errorf("invalid -masterurl URI: %q", o.masterURL)
		}
	}
	if o.kubeConfig != "" {
		if _, err := os.Stat(o.kubeConfig); err != nil {
			return err
		}
	}

	return nil
}
func ( o * KubernetesClientOptions ) Validate ( dryRun bool ) error { if dryRun && o . masterURL == " " { return errors . New ( " " ) } if o . masterURL != " " { if _ , err := url . ParseRequestURI ( o . masterURL ) ; err != nil { return fmt . Errorf ( " " , o . masterURL ) } } if o . kubeConfig != " " { if _ , err := os . Stat ( o . kubeConfig ) ; err != nil { return err } } return nil }
// Validate validates Kubernetes options.
Validate validates Kubernetes options .