kubernetes

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package kubernetes is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	Scheme = k8s_runtime.NewScheme()
)

Functions

func EnsureNamespace

func EnsureNamespace(ctx context.Context, client k8s.Interface, namespace string) error

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

func GetContextFromConfigFileIfExists(configFilePath, context string) (string, error)

GetContextFromConfigFileIfExists attempts to load a Kubernetes context from a config file, and returns an error if the context is not found.

func NewCLIClientConfig

func NewCLIClientConfig(context string) (*rest.Config, error)

NewCLIClientConfig creates a new Kubernetes client config from the local configuration file using the given context name, with a default QPS and Burst. It returns a rest.Config and an error if one occurs.

func NewClientset

func NewClientset(context string) (*k8s.Clientset, *rest.Config, error)

NewClientset creates a new Kubernetes client and rest client config by context name.

func NewDynamicClient

func NewDynamicClient(context string) (dynamic.Interface, error)

NewDynamicClient creates a new dynamic client by context name, otherwise returns an error.

func NewRuntimeClient

func NewRuntimeClient(context string, scheme *k8s_runtime.Scheme) (client.WithWatch, error)

NewRuntimeClient creates a kubernetes client using a given context and scheme.

Types

type CleanupPlan added in v0.52.0

type CleanupPlan struct {
	Namespaces  []string
	APIServices []string
	CRDs        []string
}

type Impl

type Impl struct {
}

func (*Impl) DeleteAPIService added in v0.52.0

func (i *Impl) DeleteAPIService(kubeContext, name string) error

func (*Impl) DeleteCRDs added in v0.52.0

func (i *Impl) DeleteCRDs(kubeContext string, crdNames []string) error

func (*Impl) DeleteNamespace added in v0.38.0

func (i *Impl) DeleteNamespace(kubeContext string) error

func (*Impl) DeleteNamespaceWithName added in v0.52.0

func (i *Impl) DeleteNamespaceWithName(kubeContext, namespace string) error

func (*Impl) GetKubeContext

func (i *Impl) GetKubeContext() (*api.Config, error)

GetKubeContext loads the kube configuration file and returns a Config object and an error if the file cannot be loaded.

func (*Impl) PerformRadiusCleanup added in v0.52.0

func (i *Impl) PerformRadiusCleanup(ctx context.Context, kubeContext string, plan CleanupPlan) error

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(arg0, arg1 string) error

DeleteAPIService mocks base method.

func (*MockInterface) DeleteCRDs added in v0.52.0

func (m *MockInterface) DeleteCRDs(arg0 string, arg1 []string) error

DeleteCRDs mocks base method.

func (*MockInterface) DeleteNamespace added in v0.38.0

func (m *MockInterface) DeleteNamespace(arg0 string) error

DeleteNamespace mocks base method.

func (*MockInterface) DeleteNamespaceWithName added in v0.52.0

func (m *MockInterface) DeleteNamespaceWithName(arg0, arg1 string) error

DeleteNamespaceWithName mocks base method.

func (*MockInterface) EXPECT

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(arg0 context.Context, arg1 string, arg2 CleanupPlan) error

PerformRadiusCleanup mocks base method.

type MockInterfaceDeleteAPIServiceCall added in v0.52.0

type MockInterfaceDeleteAPIServiceCall struct {
	*gomock.Call
}

MockInterfaceDeleteAPIServiceCall wrap *gomock.Call

func (*MockInterfaceDeleteAPIServiceCall) Do added in v0.52.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceDeleteAPIServiceCall) DoAndReturn added in v0.52.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceDeleteAPIServiceCall) Return added in v0.52.0

Return rewrite *gomock.Call.Return

type MockInterfaceDeleteCRDsCall added in v0.52.0

type MockInterfaceDeleteCRDsCall struct {
	*gomock.Call
}

MockInterfaceDeleteCRDsCall wrap *gomock.Call

func (*MockInterfaceDeleteCRDsCall) Do added in v0.52.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceDeleteCRDsCall) DoAndReturn added in v0.52.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceDeleteCRDsCall) Return added in v0.52.0

Return rewrite *gomock.Call.Return

type MockInterfaceDeleteNamespaceCall added in v0.38.0

type MockInterfaceDeleteNamespaceCall struct {
	*gomock.Call
}

MockInterfaceDeleteNamespaceCall wrap *gomock.Call

func (*MockInterfaceDeleteNamespaceCall) Do added in v0.38.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceDeleteNamespaceCall) DoAndReturn added in v0.38.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceDeleteNamespaceCall) Return added in v0.38.0

Return rewrite *gomock.Call.Return

type MockInterfaceDeleteNamespaceWithNameCall added in v0.52.0

type MockInterfaceDeleteNamespaceWithNameCall struct {
	*gomock.Call
}

MockInterfaceDeleteNamespaceWithNameCall wrap *gomock.Call

func (*MockInterfaceDeleteNamespaceWithNameCall) Do added in v0.52.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceDeleteNamespaceWithNameCall) DoAndReturn added in v0.52.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceDeleteNamespaceWithNameCall) Return added in v0.52.0

Return rewrite *gomock.Call.Return

type MockInterfaceGetKubeContextCall added in v0.35.0

type MockInterfaceGetKubeContextCall struct {
	*gomock.Call
}

MockInterfaceGetKubeContextCall wrap *gomock.Call

func (*MockInterfaceGetKubeContextCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceGetKubeContextCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceGetKubeContextCall) Return added in v0.35.0

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(arg0, arg1 any) *MockInterfaceDeleteAPIServiceCall

DeleteAPIService indicates an expected call of DeleteAPIService.

func (*MockInterfaceMockRecorder) DeleteCRDs added in v0.52.0

func (mr *MockInterfaceMockRecorder) DeleteCRDs(arg0, arg1 any) *MockInterfaceDeleteCRDsCall

DeleteCRDs indicates an expected call of DeleteCRDs.

func (*MockInterfaceMockRecorder) DeleteNamespace added in v0.38.0

DeleteNamespace indicates an expected call of DeleteNamespace.

func (*MockInterfaceMockRecorder) DeleteNamespaceWithName added in v0.52.0

func (mr *MockInterfaceMockRecorder) DeleteNamespaceWithName(arg0, arg1 any) *MockInterfaceDeleteNamespaceWithNameCall

DeleteNamespaceWithName indicates an expected call of DeleteNamespaceWithName.

func (*MockInterfaceMockRecorder) GetKubeContext

GetKubeContext indicates an expected call of GetKubeContext.

func (*MockInterfaceMockRecorder) PerformRadiusCleanup added in v0.52.0

func (mr *MockInterfaceMockRecorder) PerformRadiusCleanup(arg0, arg1, arg2 any) *MockInterfacePerformRadiusCleanupCall

PerformRadiusCleanup indicates an expected call of PerformRadiusCleanup.

type MockInterfacePerformRadiusCleanupCall added in v0.52.0

type MockInterfacePerformRadiusCleanupCall struct {
	*gomock.Call
}

MockInterfacePerformRadiusCleanupCall wrap *gomock.Call

func (*MockInterfacePerformRadiusCleanupCall) Do added in v0.52.0

Do rewrite *gomock.Call.Do

func (*MockInterfacePerformRadiusCleanupCall) DoAndReturn added in v0.52.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfacePerformRadiusCleanupCall) Return added in v0.52.0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL