provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

README

provider package

Contains kube and ssh provider.

SSH provider integration tests located in ../ssh/testssh/provider_test.go.

Kube provider does not contain unit tests only integration. Integration tests located in ../tests/provider/kube_test.go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultKubeProvider

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

func NewDefaultKubeProvider

func NewDefaultKubeProvider(sett settings.Settings, config *kube.Config, runnerInterface RunnerInterface) *DefaultKubeProvider

NewDefaultKubeProvider if use rest config sshProvider can be nil

func (*DefaultKubeProvider) AdditionalClientsCount

func (p *DefaultKubeProvider) AdditionalClientsCount() int

func (*DefaultKubeProvider) Cleanup

func (*DefaultKubeProvider) Client

func (*DefaultKubeProvider) HasCurrent

func (p *DefaultKubeProvider) HasCurrent() bool

func (*DefaultKubeProvider) NewAdditionalClient

func (p *DefaultKubeProvider) NewAdditionalClient(ctx context.Context) (connection.KubeClient, error)

func (*DefaultKubeProvider) NewAdditionalClientWithoutInitialize

func (p *DefaultKubeProvider) NewAdditionalClientWithoutInitialize(ctx context.Context) (connection.KubeClient, error)

NewAdditionalClientWithoutInitialize create new additional client without initialize

func (*DefaultKubeProvider) WithLoopsParams

type DefaultSSHProvider

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

func NewDefaultSSHProvider

func NewDefaultSSHProvider(sett settings.Settings, config *sshconfig.ConnectionConfig, opts ...SSHClientOption) *DefaultSSHProvider

func NewDefaultSSHProviderFromFlags

func NewDefaultSSHProviderFromFlags(sett settings.Settings, flags *sshconfig.Flags, opts ...sshconfig.ValidateOption) (*DefaultSSHProvider, error)

func (*DefaultSSHProvider) AdditionalClients

func (p *DefaultSSHProvider) AdditionalClients() []connection.SSHClient

AdditionalClients please use for testing purposes only!

func (*DefaultSSHProvider) Cleanup

func (*DefaultSSHProvider) Client

func (*DefaultSSHProvider) HasCurrent

func (p *DefaultSSHProvider) HasCurrent() bool

func (*DefaultSSHProvider) NewAdditionalClient

func (p *DefaultSSHProvider) NewAdditionalClient(ctx context.Context) (connection.SSHClient, error)

func (*DefaultSSHProvider) NewStandaloneClient

func (p *DefaultSSHProvider) NewStandaloneClient(ctx context.Context, sess *session.Session, privateKeys []session.AgentPrivateKey, opts ...connection.StandaloneClientOpt) (connection.SSHClient, error)

func (*DefaultSSHProvider) SwitchClient

func (p *DefaultSSHProvider) SwitchClient(ctx context.Context, sess *session.Session, privateKeys []session.AgentPrivateKey) (connection.SSHClient, error)

func (*DefaultSSHProvider) SwitchToDefault

func (p *DefaultSSHProvider) SwitchToDefault(ctx context.Context) (connection.SSHClient, error)

func (*DefaultSSHProvider) WithID

func (*DefaultSSHProvider) WithOptions

func (p *DefaultSSHProvider) WithOptions(opts ...SSHClientOption) *DefaultSSHProvider

WithOptions warning passed options fully rewrite options passed to NewDefaultSSHProvider

type ErrorSSHProvider

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

func NewErrorSSHProvider

func NewErrorSSHProvider(err error) *ErrorSSHProvider

NewErrorSSHProvider Special provider that always return error for all operations expected cleanup it can be used with GetRunnerInterface if you are you sure that you do not use KubeClient over SSH

func (*ErrorSSHProvider) Cleanup

func (p *ErrorSSHProvider) Cleanup(context.Context) error

func (*ErrorSSHProvider) Client

func (*ErrorSSHProvider) NewAdditionalClient

func (p *ErrorSSHProvider) NewAdditionalClient(context.Context) (connection.SSHClient, error)

func (*ErrorSSHProvider) SwitchClient

func (*ErrorSSHProvider) SwitchToDefault

func (p *ErrorSSHProvider) SwitchToDefault(context.Context) (connection.SSHClient, error)

type FakeKubeProvider

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

func NewFakeKubeProvider

func NewFakeKubeProvider(gvrs ...map[schema.GroupVersionResource]string) *FakeKubeProvider

func (*FakeKubeProvider) Cleanup

func (p *FakeKubeProvider) Cleanup(context.Context) error

func (*FakeKubeProvider) Client

func (*FakeKubeProvider) NewAdditionalClient

func (p *FakeKubeProvider) NewAdditionalClient(ctx context.Context) (connection.KubeClient, error)

func (*FakeKubeProvider) NewAdditionalClientWithoutInitialize

func (p *FakeKubeProvider) NewAdditionalClientWithoutInitialize(ctx context.Context) (connection.KubeClient, error)

type KubeProviderLoopsParams

type KubeProviderLoopsParams struct {
	InitClient   retry.Params
	WaitingReady retry.Params
}

type RunnerInterface

type RunnerInterface interface {
	IsSwitched(ctx context.Context) (bool, error)
	SetNodeInterface(ctx context.Context, client *kube.KubernetesClient, opts ...SetNodeInterfaceOpt) error
	Finalize(isError bool)
	InitOptions() []kube.InitOpt
}

func GetRunnerInterface

func GetRunnerInterface(config *kube.Config, sett settings.Settings, sshProvider connection.SSHProvider, opts ...RunnerInterfaceOpt) (RunnerInterface, error)

type RunnerInterfaceLocal

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

func NewRunnerInterfaceLocal

func NewRunnerInterfaceLocal(sett settings.Settings) *RunnerInterfaceLocal

func (*RunnerInterfaceLocal) Finalize

func (r *RunnerInterfaceLocal) Finalize(bool)

func (*RunnerInterfaceLocal) InitOptions

func (r *RunnerInterfaceLocal) InitOptions() []kube.InitOpt

func (*RunnerInterfaceLocal) IsSwitched

func (r *RunnerInterfaceLocal) IsSwitched(context.Context) (bool, error)

func (*RunnerInterfaceLocal) SetNodeInterface

func (r *RunnerInterfaceLocal) SetNodeInterface(_ context.Context, client *kube.KubernetesClient, _ ...SetNodeInterfaceOpt) error

type RunnerInterfaceNoAction

type RunnerInterfaceNoAction struct{}

func (*RunnerInterfaceNoAction) Finalize

func (*RunnerInterfaceNoAction) Finalize(bool)

func (*RunnerInterfaceNoAction) InitOptions

func (*RunnerInterfaceNoAction) InitOptions() []kube.InitOpt

func (*RunnerInterfaceNoAction) IsSwitched

func (*RunnerInterfaceNoAction) SetNodeInterface

type RunnerInterfaceOpt

type RunnerInterfaceOpt func(RunnerInterface)

func RunnerInterfaceWithInitOpts

func RunnerInterfaceWithInitOpts(opts ...kube.InitOpt) RunnerInterfaceOpt

type RunnerInterfaceSSH

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

func NewRunnerInterfaceSSH

func NewRunnerInterfaceSSH(sett settings.Settings, sshProvider connection.SSHProvider) *RunnerInterfaceSSH

func (*RunnerInterfaceSSH) Finalize

func (r *RunnerInterfaceSSH) Finalize(isError bool)

func (*RunnerInterfaceSSH) InitOptions

func (r *RunnerInterfaceSSH) InitOptions() []kube.InitOpt

func (*RunnerInterfaceSSH) IsSwitched

func (r *RunnerInterfaceSSH) IsSwitched(ctx context.Context) (bool, error)

func (*RunnerInterfaceSSH) SetNodeInterface

func (r *RunnerInterfaceSSH) SetNodeInterface(ctx context.Context, client *kube.KubernetesClient, opts ...SetNodeInterfaceOpt) error

func (*RunnerInterfaceSSH) WithInitOptions

func (r *RunnerInterfaceSSH) WithInitOptions(opts ...kube.InitOpt) *RunnerInterfaceSSH

func (*RunnerInterfaceSSH) WithLoopParams

type RunnerInterfaceSSHLoopsParams

type RunnerInterfaceSSHLoopsParams struct {
	AwaitAvailabilityOverSSH retry.Params
}

type SSHClientOption

type SSHClientOption func(options *SSHClientOptions)

func SSHClientWithForceGoSSH

func SSHClientWithForceGoSSH() SSHClientOption

func SSHClientWithID

func SSHClientWithID(id string) SSHClientOption

func SSHClientWithLoopsParams

func SSHClientWithLoopsParams(params gossh.ClientLoopsParams) SSHClientOption

func SSHClientWithNoInitializeAgent

func SSHClientWithNoInitializeAgent() SSHClientOption

func SSHClientWithStartAfterCreate

func SSHClientWithStartAfterCreate(f bool) SSHClientOption

type SSHClientOptions

type SSHClientOptions struct {
	InitializeNewAgent bool
	ForceGoSSH         bool
	LoopsParams        gossh.ClientLoopsParams
	StartClient        bool
	ClientID           string
}

type SetNodeInterfaceOpt

type SetNodeInterfaceOpt func(opts *SetNodeInterfaceOpts)

func SetNodeInterfaceOptWithNewNodeInterface

func SetNodeInterfaceOptWithNewNodeInterface() SetNodeInterfaceOpt

func SetNodeInterfaceOptWithRunChecks

func SetNodeInterfaceOptWithRunChecks() SetNodeInterfaceOpt

type SetNodeInterfaceOpts

type SetNodeInterfaceOpts struct {
	RunChecks        bool
	NewNodeInterface bool
}

Jump to

Keyboard shortcuts

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