Documentation ¶
Index ¶
- Constants
- Variables
- type Context
- type Factory
- func (f Factory) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
- func (f Factory) NewBuilder() *resource.Builder
- func (f Factory) OpenAPISchema() (openapi.Resources, error)
- func (f Factory) OpenAPIV3Client() (openapiclient.Client, error)
- func (f Factory) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
- func (f Factory) Validator(validationDirective string) (validation.Schema, error)
- type MockClient
- func (c MockClient) AllDiscoveryDo(_ context.Context, _, _ string) (map[string][]byte, error)
- func (c MockClient) CreatePerRPCCredentials(_ context.Context, _, _ string, _ []string, _ int64) (credentials.PerRPCCredentials, error)
- func (c MockClient) EnvoyDo(ctx context.Context, podName, podNamespace, method, path string) ([]byte, error)
- func (c MockClient) EnvoyDoWithPort(ctx context.Context, podName, podNamespace, method, path string, port int) ([]byte, error)
- func (c MockClient) NewPortForwarder(_, _, _ string, _, _ int) (kube.PortForwarder, error)
- type MockPortForwarder
- type NewFakeContextOption
- type RootFlags
Constants ¶
View Source
const ( FlagKubeConfig = "kubeconfig" FlagContext = "context" FlagImpersonate = "as" FlagImpersonateUID = "as-uid" FlagImpersonateGroup = "as-group" FlagNamespace = "namespace" FlagIstioNamespace = "istioNamespace" )
Variables ¶
View Source
var MakeKubeFactory = func(k kube.CLIClient) util.Factory { kf := k.UtilFactory() return Factory{ PartialFactory: kf, full: util.NewFactory(kf), } }
MakeKubeFactory turns a partial kubetl factory from CLIClient into a full util.Factory This is done under istioctl/ to avoid excessive binary bloat in other packages; this pulls in around 10mb of dependencies.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { // CLIClient returns a client for the default revision CLIClient() (kube.CLIClient, error) // CLIClientWithRevision returns a client for the given revision CLIClientWithRevision(rev string) (kube.CLIClient, error) // InferPodInfoFromTypedResource returns the pod name and namespace for the given typed resource InferPodInfoFromTypedResource(name, namespace string) (pod string, ns string, err error) // InferPodsFromTypedResource returns the pod names and namespace for the given typed resource InferPodsFromTypedResource(name, namespace string) ([]string, string, error) // Namespace returns the namespace specified by the user 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 // CLIClientsForContexts returns clients for all the given contexts in a kubeconfig. CLIClientsForContexts(contexts []string) ([]kube.CLIClient, error) }
func NewCLIContext ¶
func NewFakeContext ¶
func NewFakeContext(opts *NewFakeContextOption) Context
type Factory ¶
type Factory struct { kube.PartialFactory // contains filtered or unexported fields }
func (Factory) ClientForMapping ¶
func (f Factory) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
func (Factory) NewBuilder ¶
func (Factory) OpenAPIV3Client ¶
func (f Factory) OpenAPIV3Client() (openapiclient.Client, error)
func (Factory) UnstructuredClientForMapping ¶
func (f Factory) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
type MockClient ¶
type MockClient struct { // Results is a map of podName to the results of the expected test on the pod Results map[string][]byte kube.CLIClient }
func (MockClient) AllDiscoveryDo ¶
func (MockClient) CreatePerRPCCredentials ¶
func (c MockClient) CreatePerRPCCredentials(_ context.Context, _, _ string, _ []string, _ int64, ) (credentials.PerRPCCredentials, error)
func (MockClient) EnvoyDoWithPort ¶
func (MockClient) NewPortForwarder ¶
func (c MockClient) NewPortForwarder(_, _, _ string, _, _ int) (kube.PortForwarder, error)
type MockPortForwarder ¶
type MockPortForwarder struct{}
func (MockPortForwarder) Address ¶
func (m MockPortForwarder) Address() string
func (MockPortForwarder) Close ¶
func (m MockPortForwarder) Close()
func (MockPortForwarder) ErrChan ¶
func (m MockPortForwarder) ErrChan() <-chan error
func (MockPortForwarder) Start ¶
func (m MockPortForwarder) Start() error
func (MockPortForwarder) WaitForStop ¶
func (m MockPortForwarder) WaitForStop()
type NewFakeContextOption ¶
type RootFlags ¶
type RootFlags struct {
// contains filtered or unexported fields
}
func AddRootFlags ¶
func (*RootFlags) DefaultNamespace ¶
DefaultNamespace returns the default namespace to use.
func (*RootFlags) IstioNamespace ¶
IstioNamespace returns the istioNamespace flag value.
Click to show internal directories.
Click to hide internal directories.