k8s

package
v0.0.0-...-56579fc Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIdProvider

func NewIdProvider(clusterID, nodeID string) dataprovider.IdProvider

Types

type ClientGetter

type ClientGetter struct{}

func (ClientGetter) GetClient

func (ClientGetter) GetClient(log *logp.Logger, kubeConfig string, options kubernetes.KubeClientOptions) (k8s.Interface, error)

type ClientGetterAPI

type ClientGetterAPI interface {
	GetClient(log *logp.Logger, kubeConfig string, options kubernetes.KubeClientOptions) (k8s.Interface, error)
}

type ClusterNameProviderAPI

type ClusterNameProviderAPI interface {
	GetClusterName(ctx context.Context, cfg *config.Config) (string, error)
}

type DataProvider

type DataProvider struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) DataProvider

func (DataProvider) EnrichEvent

func (k DataProvider) EnrichEvent(event *beat.Event, _ fetching.ResourceMetadata) error

type EKSClusterNameProvider

type EKSClusterNameProvider struct {
	AwsCfg              aws.Config
	EKSMetadataProvider awslib.MetadataProvider
	ClusterNameProvider awslib.EKSClusterNameProviderAPI
	KubeClient          kubernetes.Interface
}

func (EKSClusterNameProvider) GetClusterName

func (provider EKSClusterNameProvider) GetClusterName(ctx context.Context, _ *config.Config) (string, error)

type KubernetesClusterNameProvider

type KubernetesClusterNameProvider struct {
	KubeClient kubernetes.Interface
}

func (KubernetesClusterNameProvider) GetClusterName

func (provider KubernetesClusterNameProvider) GetClusterName(_ context.Context, cfg *config.Config) (string, error)

type MockClientGetterAPI

type MockClientGetterAPI struct {
	mock.Mock
}

MockClientGetterAPI is an autogenerated mock type for the ClientGetterAPI type

func NewMockClientGetterAPI

func NewMockClientGetterAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClientGetterAPI

NewMockClientGetterAPI creates a new instance of MockClientGetterAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClientGetterAPI) EXPECT

func (*MockClientGetterAPI) GetClient

GetClient provides a mock function with given fields: log, kubeConfig, options

type MockClientGetterAPI_Expecter

type MockClientGetterAPI_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockClientGetterAPI_Expecter) GetClient

func (_e *MockClientGetterAPI_Expecter) GetClient(log interface{}, kubeConfig interface{}, options interface{}) *MockClientGetterAPI_GetClient_Call

GetClient is a helper method to define mock.On call

  • log *logp.Logger
  • kubeConfig string
  • options kubernetes.KubeClientOptions

type MockClientGetterAPI_GetClient_Call

type MockClientGetterAPI_GetClient_Call struct {
	*mock.Call
}

MockClientGetterAPI_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient'

func (*MockClientGetterAPI_GetClient_Call) Return

func (*MockClientGetterAPI_GetClient_Call) Run

type MockClusterNameProviderAPI

type MockClusterNameProviderAPI struct {
	mock.Mock
}

MockClusterNameProviderAPI is an autogenerated mock type for the ClusterNameProviderAPI type

func NewMockClusterNameProviderAPI

func NewMockClusterNameProviderAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClusterNameProviderAPI

NewMockClusterNameProviderAPI creates a new instance of MockClusterNameProviderAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClusterNameProviderAPI) EXPECT

func (*MockClusterNameProviderAPI) GetClusterName

func (_m *MockClusterNameProviderAPI) GetClusterName(ctx context.Context, cfg *config.Config) (string, error)

GetClusterName provides a mock function with given fields: ctx, cfg

type MockClusterNameProviderAPI_Expecter

type MockClusterNameProviderAPI_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockClusterNameProviderAPI_Expecter) GetClusterName

func (_e *MockClusterNameProviderAPI_Expecter) GetClusterName(ctx interface{}, cfg interface{}) *MockClusterNameProviderAPI_GetClusterName_Call

GetClusterName is a helper method to define mock.On call

  • ctx context.Context
  • cfg *config.Config

type MockClusterNameProviderAPI_GetClusterName_Call

type MockClusterNameProviderAPI_GetClusterName_Call struct {
	*mock.Call
}

MockClusterNameProviderAPI_GetClusterName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClusterName'

func (*MockClusterNameProviderAPI_GetClusterName_Call) Return

func (*MockClusterNameProviderAPI_GetClusterName_Call) Run

func (*MockClusterNameProviderAPI_GetClusterName_Call) RunAndReturn

type MockOption

type MockOption struct {
	mock.Mock
}

MockOption is an autogenerated mock type for the Option type

func NewMockOption

func NewMockOption(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOption

NewMockOption creates a new instance of MockOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockOption) EXPECT

func (_m *MockOption) EXPECT() *MockOption_Expecter

func (*MockOption) Execute

func (_m *MockOption) Execute(_a0 *DataProvider)

Execute provides a mock function with given fields: _a0

type MockOption_Execute_Call

type MockOption_Execute_Call struct {
	*mock.Call
}

MockOption_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockOption_Execute_Call) Return

func (*MockOption_Execute_Call) Run

func (*MockOption_Execute_Call) RunAndReturn

func (_c *MockOption_Execute_Call) RunAndReturn(run func(*DataProvider)) *MockOption_Execute_Call

type MockOption_Expecter

type MockOption_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOption_Expecter) Execute

func (_e *MockOption_Expecter) Execute(_a0 interface{}) *MockOption_Execute_Call

Execute is a helper method to define mock.On call

  • _a0 *DataProvider

type Option

type Option func(*DataProvider)

func WithClusterID

func WithClusterID(id string) Option

func WithClusterName

func WithClusterName(name string) Option

func WithClusterVersion

func WithClusterVersion(version string) Option

Jump to

Keyboard shortcuts

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