Documentation
¶
Overview ¶
Package kubernetes is a generated GoMock package.
Index ¶
- Variables
- func EnsureNamespace(ctx context.Context, client k8s.Interface, namespace string) error
- func GetContextFromConfigFileIfExists(configFilePath, context string) (string, error)
- func NewCLIClientConfig(contextName string) (*rest.Config, error)
- func NewClientset(context string) (*k8s.Clientset, *rest.Config, error)
- func NewDynamicClient(context string) (dynamic.Interface, error)
- func NewRuntimeClient(context string, scheme *k8s_runtime.Scheme) (client.WithWatch, error)
- type CleanupPlan
- type Impl
- func (i *Impl) DeleteAPIService(kubeContext, name string) error
- func (i *Impl) DeleteCRDs(kubeContext string, crdNames []string) error
- func (i *Impl) DeleteNamespace(kubeContext string) error
- func (i *Impl) DeleteNamespaceWithName(kubeContext, namespace string) error
- func (i *Impl) GetKubeContext() (*api.Config, error)
- func (i *Impl) PerformRadiusCleanup(ctx context.Context, kubeContext string, plan CleanupPlan) error
- type Interface
- type MockInterface
- func (m *MockInterface) DeleteAPIService(kubeContext, name string) error
- func (m *MockInterface) DeleteCRDs(kubeContext string, crdNames []string) error
- func (m *MockInterface) DeleteNamespace(kubeContext string) error
- func (m *MockInterface) DeleteNamespaceWithName(kubeContext, namespace string) error
- func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder
- func (m *MockInterface) GetKubeContext() (*api.Config, error)
- func (m *MockInterface) PerformRadiusCleanup(ctx context.Context, kubeContext string, plan CleanupPlan) error
- type MockInterfaceDeleteAPIServiceCall
- func (c *MockInterfaceDeleteAPIServiceCall) Do(f func(string, string) error) *MockInterfaceDeleteAPIServiceCall
- func (c *MockInterfaceDeleteAPIServiceCall) DoAndReturn(f func(string, string) error) *MockInterfaceDeleteAPIServiceCall
- func (c *MockInterfaceDeleteAPIServiceCall) Return(arg0 error) *MockInterfaceDeleteAPIServiceCall
- type MockInterfaceDeleteCRDsCall
- type MockInterfaceDeleteNamespaceCall
- func (c *MockInterfaceDeleteNamespaceCall) Do(f func(string) error) *MockInterfaceDeleteNamespaceCall
- func (c *MockInterfaceDeleteNamespaceCall) DoAndReturn(f func(string) error) *MockInterfaceDeleteNamespaceCall
- func (c *MockInterfaceDeleteNamespaceCall) Return(arg0 error) *MockInterfaceDeleteNamespaceCall
- type MockInterfaceDeleteNamespaceWithNameCall
- func (c *MockInterfaceDeleteNamespaceWithNameCall) Do(f func(string, string) error) *MockInterfaceDeleteNamespaceWithNameCall
- func (c *MockInterfaceDeleteNamespaceWithNameCall) DoAndReturn(f func(string, string) error) *MockInterfaceDeleteNamespaceWithNameCall
- func (c *MockInterfaceDeleteNamespaceWithNameCall) Return(arg0 error) *MockInterfaceDeleteNamespaceWithNameCall
- type MockInterfaceGetKubeContextCall
- func (c *MockInterfaceGetKubeContextCall) Do(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall
- func (c *MockInterfaceGetKubeContextCall) DoAndReturn(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall
- func (c *MockInterfaceGetKubeContextCall) Return(arg0 *api.Config, arg1 error) *MockInterfaceGetKubeContextCall
- type MockInterfaceMockRecorder
- func (mr *MockInterfaceMockRecorder) DeleteAPIService(kubeContext, name any) *MockInterfaceDeleteAPIServiceCall
- func (mr *MockInterfaceMockRecorder) DeleteCRDs(kubeContext, crdNames any) *MockInterfaceDeleteCRDsCall
- func (mr *MockInterfaceMockRecorder) DeleteNamespace(kubeContext any) *MockInterfaceDeleteNamespaceCall
- func (mr *MockInterfaceMockRecorder) DeleteNamespaceWithName(kubeContext, namespace any) *MockInterfaceDeleteNamespaceWithNameCall
- func (mr *MockInterfaceMockRecorder) GetKubeContext() *MockInterfaceGetKubeContextCall
- func (mr *MockInterfaceMockRecorder) PerformRadiusCleanup(ctx, kubeContext, plan any) *MockInterfacePerformRadiusCleanupCall
- type MockInterfacePerformRadiusCleanupCall
- func (c *MockInterfacePerformRadiusCleanupCall) Do(f func(context.Context, string, CleanupPlan) error) *MockInterfacePerformRadiusCleanupCall
- func (c *MockInterfacePerformRadiusCleanupCall) DoAndReturn(f func(context.Context, string, CleanupPlan) error) *MockInterfacePerformRadiusCleanupCall
- func (c *MockInterfacePerformRadiusCleanupCall) Return(arg0 error) *MockInterfacePerformRadiusCleanupCall
Constants ¶
This section is empty.
Variables ¶
var (
Scheme = k8s_runtime.NewScheme()
)
Functions ¶
func EnsureNamespace ¶
EnsureNamespace checks if a namespace exists in a Kubernetes cluster and creates it if it doesn't, returning an error if it fails.
func GetContextFromConfigFileIfExists ¶
GetContextFromConfigFileIfExists attempts to load a Kubernetes context from a config file, and returns an error if the context is not found. If configFilePath is empty, it loads the kubeconfig files listed in KUBECONFIG, or ~/.kube/config when KUBECONFIG is not set.
func NewCLIClientConfig ¶
NewCLIClientConfig builds a Kubernetes client config for the rad CLI with the CLI QPS and Burst defaults. It selects the kubeconfig files the same way as loadCLIConfig and uses contextName, or the current context when contextName is empty.
Inside a pod, client-go uses the pod's service account when the only problem with the kubeconfig is that no cluster server is selected. That includes an empty kubeconfig and a kubeconfig with no current context. A kubeconfig that selects a cluster server always wins. Helm does the same, so rad and Helm use the same cluster and credentials. Outside a pod, Helm falls back to http://localhost:8080 in those cases, and NewCLIClientConfig returns an error.
func NewClientset ¶
NewClientset creates a new Kubernetes client and rest client config by context name.
func NewDynamicClient ¶
NewDynamicClient creates a new dynamic client by context name, otherwise returns an error.
func NewRuntimeClient ¶
NewRuntimeClient creates a kubernetes client using a given context and scheme.
Types ¶
type CleanupPlan ¶ added in v0.52.0
type Impl ¶
type Impl struct {
}
func (*Impl) DeleteAPIService ¶ added in v0.52.0
func (*Impl) DeleteCRDs ¶ added in v0.52.0
func (*Impl) DeleteNamespace ¶ added in v0.38.0
func (*Impl) DeleteNamespaceWithName ¶ added in v0.52.0
func (*Impl) GetKubeContext ¶
GetKubeContext loads the kubeconfig files listed in KUBECONFIG, or ~/.kube/config when KUBECONFIG is not set, and returns the merged Config object. It returns an error if no usable kubeconfig can be loaded.
func (*Impl) PerformRadiusCleanup ¶ added in v0.52.0
type Interface ¶
type Interface interface {
GetKubeContext() (*api.Config, error)
DeleteNamespace(kubeContext string) error
DeleteNamespaceWithName(kubeContext, namespace string) error
DeleteCRDs(kubeContext string, crdNames []string) error
DeleteAPIService(kubeContext, name string) error
PerformRadiusCleanup(ctx context.Context, kubeContext string, plan CleanupPlan) error
}
type MockInterface ¶
type MockInterface struct {
// contains filtered or unexported fields
}
MockInterface is a mock of Interface interface.
func NewMockInterface ¶
func NewMockInterface(ctrl *gomock.Controller) *MockInterface
NewMockInterface creates a new mock instance.
func (*MockInterface) DeleteAPIService ¶ added in v0.52.0
func (m *MockInterface) DeleteAPIService(kubeContext, name string) error
DeleteAPIService mocks base method.
func (*MockInterface) DeleteCRDs ¶ added in v0.52.0
func (m *MockInterface) DeleteCRDs(kubeContext string, crdNames []string) error
DeleteCRDs mocks base method.
func (*MockInterface) DeleteNamespace ¶ added in v0.38.0
func (m *MockInterface) DeleteNamespace(kubeContext string) error
DeleteNamespace mocks base method.
func (*MockInterface) DeleteNamespaceWithName ¶ added in v0.52.0
func (m *MockInterface) DeleteNamespaceWithName(kubeContext, namespace string) error
DeleteNamespaceWithName mocks base method.
func (*MockInterface) EXPECT ¶
func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockInterface) GetKubeContext ¶
func (m *MockInterface) GetKubeContext() (*api.Config, error)
GetKubeContext mocks base method.
func (*MockInterface) PerformRadiusCleanup ¶ added in v0.52.0
func (m *MockInterface) PerformRadiusCleanup(ctx context.Context, kubeContext string, plan CleanupPlan) error
PerformRadiusCleanup mocks base method.
type MockInterfaceDeleteAPIServiceCall ¶ added in v0.52.0
MockInterfaceDeleteAPIServiceCall wrap *gomock.Call
func (*MockInterfaceDeleteAPIServiceCall) Do ¶ added in v0.52.0
func (c *MockInterfaceDeleteAPIServiceCall) Do(f func(string, string) error) *MockInterfaceDeleteAPIServiceCall
Do rewrite *gomock.Call.Do
func (*MockInterfaceDeleteAPIServiceCall) DoAndReturn ¶ added in v0.52.0
func (c *MockInterfaceDeleteAPIServiceCall) DoAndReturn(f func(string, string) error) *MockInterfaceDeleteAPIServiceCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfaceDeleteAPIServiceCall) Return ¶ added in v0.52.0
func (c *MockInterfaceDeleteAPIServiceCall) Return(arg0 error) *MockInterfaceDeleteAPIServiceCall
Return rewrite *gomock.Call.Return
type MockInterfaceDeleteCRDsCall ¶ added in v0.52.0
MockInterfaceDeleteCRDsCall wrap *gomock.Call
func (*MockInterfaceDeleteCRDsCall) Do ¶ added in v0.52.0
func (c *MockInterfaceDeleteCRDsCall) Do(f func(string, []string) error) *MockInterfaceDeleteCRDsCall
Do rewrite *gomock.Call.Do
func (*MockInterfaceDeleteCRDsCall) DoAndReturn ¶ added in v0.52.0
func (c *MockInterfaceDeleteCRDsCall) DoAndReturn(f func(string, []string) error) *MockInterfaceDeleteCRDsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfaceDeleteCRDsCall) Return ¶ added in v0.52.0
func (c *MockInterfaceDeleteCRDsCall) Return(arg0 error) *MockInterfaceDeleteCRDsCall
Return rewrite *gomock.Call.Return
type MockInterfaceDeleteNamespaceCall ¶ added in v0.38.0
MockInterfaceDeleteNamespaceCall wrap *gomock.Call
func (*MockInterfaceDeleteNamespaceCall) Do ¶ added in v0.38.0
func (c *MockInterfaceDeleteNamespaceCall) Do(f func(string) error) *MockInterfaceDeleteNamespaceCall
Do rewrite *gomock.Call.Do
func (*MockInterfaceDeleteNamespaceCall) DoAndReturn ¶ added in v0.38.0
func (c *MockInterfaceDeleteNamespaceCall) DoAndReturn(f func(string) error) *MockInterfaceDeleteNamespaceCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfaceDeleteNamespaceCall) Return ¶ added in v0.38.0
func (c *MockInterfaceDeleteNamespaceCall) Return(arg0 error) *MockInterfaceDeleteNamespaceCall
Return rewrite *gomock.Call.Return
type MockInterfaceDeleteNamespaceWithNameCall ¶ added in v0.52.0
MockInterfaceDeleteNamespaceWithNameCall wrap *gomock.Call
func (*MockInterfaceDeleteNamespaceWithNameCall) Do ¶ added in v0.52.0
func (c *MockInterfaceDeleteNamespaceWithNameCall) Do(f func(string, string) error) *MockInterfaceDeleteNamespaceWithNameCall
Do rewrite *gomock.Call.Do
func (*MockInterfaceDeleteNamespaceWithNameCall) DoAndReturn ¶ added in v0.52.0
func (c *MockInterfaceDeleteNamespaceWithNameCall) DoAndReturn(f func(string, string) error) *MockInterfaceDeleteNamespaceWithNameCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfaceDeleteNamespaceWithNameCall) Return ¶ added in v0.52.0
func (c *MockInterfaceDeleteNamespaceWithNameCall) Return(arg0 error) *MockInterfaceDeleteNamespaceWithNameCall
Return rewrite *gomock.Call.Return
type MockInterfaceGetKubeContextCall ¶ added in v0.35.0
MockInterfaceGetKubeContextCall wrap *gomock.Call
func (*MockInterfaceGetKubeContextCall) Do ¶ added in v0.35.0
func (c *MockInterfaceGetKubeContextCall) Do(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall
Do rewrite *gomock.Call.Do
func (*MockInterfaceGetKubeContextCall) DoAndReturn ¶ added in v0.35.0
func (c *MockInterfaceGetKubeContextCall) DoAndReturn(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfaceGetKubeContextCall) Return ¶ added in v0.35.0
func (c *MockInterfaceGetKubeContextCall) Return(arg0 *api.Config, arg1 error) *MockInterfaceGetKubeContextCall
Return rewrite *gomock.Call.Return
type MockInterfaceMockRecorder ¶
type MockInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockInterfaceMockRecorder is the mock recorder for MockInterface.
func (*MockInterfaceMockRecorder) DeleteAPIService ¶ added in v0.52.0
func (mr *MockInterfaceMockRecorder) DeleteAPIService(kubeContext, name any) *MockInterfaceDeleteAPIServiceCall
DeleteAPIService indicates an expected call of DeleteAPIService.
func (*MockInterfaceMockRecorder) DeleteCRDs ¶ added in v0.52.0
func (mr *MockInterfaceMockRecorder) DeleteCRDs(kubeContext, crdNames any) *MockInterfaceDeleteCRDsCall
DeleteCRDs indicates an expected call of DeleteCRDs.
func (*MockInterfaceMockRecorder) DeleteNamespace ¶ added in v0.38.0
func (mr *MockInterfaceMockRecorder) DeleteNamespace(kubeContext any) *MockInterfaceDeleteNamespaceCall
DeleteNamespace indicates an expected call of DeleteNamespace.
func (*MockInterfaceMockRecorder) DeleteNamespaceWithName ¶ added in v0.52.0
func (mr *MockInterfaceMockRecorder) DeleteNamespaceWithName(kubeContext, namespace any) *MockInterfaceDeleteNamespaceWithNameCall
DeleteNamespaceWithName indicates an expected call of DeleteNamespaceWithName.
func (*MockInterfaceMockRecorder) GetKubeContext ¶
func (mr *MockInterfaceMockRecorder) GetKubeContext() *MockInterfaceGetKubeContextCall
GetKubeContext indicates an expected call of GetKubeContext.
func (*MockInterfaceMockRecorder) PerformRadiusCleanup ¶ added in v0.52.0
func (mr *MockInterfaceMockRecorder) PerformRadiusCleanup(ctx, kubeContext, plan any) *MockInterfacePerformRadiusCleanupCall
PerformRadiusCleanup indicates an expected call of PerformRadiusCleanup.
type MockInterfacePerformRadiusCleanupCall ¶ added in v0.52.0
MockInterfacePerformRadiusCleanupCall wrap *gomock.Call
func (*MockInterfacePerformRadiusCleanupCall) Do ¶ added in v0.52.0
func (c *MockInterfacePerformRadiusCleanupCall) Do(f func(context.Context, string, CleanupPlan) error) *MockInterfacePerformRadiusCleanupCall
Do rewrite *gomock.Call.Do
func (*MockInterfacePerformRadiusCleanupCall) DoAndReturn ¶ added in v0.52.0
func (c *MockInterfacePerformRadiusCleanupCall) DoAndReturn(f func(context.Context, string, CleanupPlan) error) *MockInterfacePerformRadiusCleanupCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockInterfacePerformRadiusCleanupCall) Return ¶ added in v0.52.0
func (c *MockInterfacePerformRadiusCleanupCall) Return(arg0 error) *MockInterfacePerformRadiusCleanupCall
Return rewrite *gomock.Call.Return
Directories
¶
| Path | Synopsis |
|---|---|
|
logstream contains functionality for streaming logs for an entire application from Kubernetes.
|
logstream contains functionality for streaming logs for an entire application from Kubernetes. |
|
portforward contains functionality for port-forwarding an entire application from Kubernetes.
|
portforward contains functionality for port-forwarding an entire application from Kubernetes. |