Documentation
¶
Index ¶
- Variables
- type DefaultKubeProvider
- func (p *DefaultKubeProvider) AdditionalClientsCount() int
- func (p *DefaultKubeProvider) Cleanup(context.Context) error
- func (p *DefaultKubeProvider) Client(ctx context.Context) (connection.KubeClient, error)
- func (p *DefaultKubeProvider) HasCurrent() bool
- func (p *DefaultKubeProvider) NewAdditionalClient(ctx context.Context) (connection.KubeClient, error)
- func (p *DefaultKubeProvider) NewAdditionalClientWithoutInitialize(ctx context.Context) (connection.KubeClient, error)
- func (p *DefaultKubeProvider) WithLoopsParams(l KubeProviderLoopsParams) *DefaultKubeProvider
- type DefaultSSHProvider
- func (p *DefaultSSHProvider) AdditionalClients() []connection.SSHClient
- func (p *DefaultSSHProvider) Cleanup(context.Context) error
- func (p *DefaultSSHProvider) Client(ctx context.Context) (connection.SSHClient, error)
- func (p *DefaultSSHProvider) HasCurrent() bool
- func (p *DefaultSSHProvider) NewAdditionalClient(ctx context.Context) (connection.SSHClient, error)
- func (p *DefaultSSHProvider) NewStandaloneClient(ctx context.Context, sess *session.Session, ...) (connection.SSHClient, error)
- func (p *DefaultSSHProvider) SwitchClient(ctx context.Context, sess *session.Session, ...) (connection.SSHClient, error)
- func (p *DefaultSSHProvider) SwitchToDefault(ctx context.Context) (connection.SSHClient, error)
- func (p *DefaultSSHProvider) WithID(id string) *DefaultSSHProvider
- func (p *DefaultSSHProvider) WithOptions(opts ...SSHClientOption) *DefaultSSHProvider
- type ErrorSSHProvider
- func (p *ErrorSSHProvider) Cleanup(context.Context) error
- func (p *ErrorSSHProvider) Client(context.Context) (connection.SSHClient, error)
- func (p *ErrorSSHProvider) NewAdditionalClient(context.Context) (connection.SSHClient, error)
- func (p *ErrorSSHProvider) NewStandaloneClient(context.Context, *session.Session, []session.AgentPrivateKey, ...) (connection.SSHClient, error)
- func (p *ErrorSSHProvider) SwitchClient(context.Context, *session.Session, []session.AgentPrivateKey) (connection.SSHClient, error)
- func (p *ErrorSSHProvider) SwitchToDefault(context.Context) (connection.SSHClient, error)
- type ErrorSSHProviderInitializer
- type FakeKubeProvider
- func (p *FakeKubeProvider) Cleanup(context.Context) error
- func (p *FakeKubeProvider) Client(context.Context) (connection.KubeClient, error)
- func (p *FakeKubeProvider) NewAdditionalClient(ctx context.Context) (connection.KubeClient, error)
- func (p *FakeKubeProvider) NewAdditionalClientWithoutInitialize(ctx context.Context) (connection.KubeClient, error)
- type FakeKubeProviderInitializer
- type KubeProviderInitializer
- type KubeProviderInitializerWithCleanup
- type KubeProviderLoopsParams
- type ProvideErrorSSHProviderInitializer
- type RunnerInterface
- type RunnerInterfaceLocal
- func (r *RunnerInterfaceLocal) Finalize(bool)
- func (r *RunnerInterfaceLocal) InitOptions() []kube.InitOpt
- func (r *RunnerInterfaceLocal) IsSwitched(context.Context) (bool, error)
- func (r *RunnerInterfaceLocal) SetNodeInterface(_ context.Context, client *kube.KubernetesClient, _ ...SetNodeInterfaceOpt) error
- type RunnerInterfaceNoAction
- func (*RunnerInterfaceNoAction) Finalize(bool)
- func (*RunnerInterfaceNoAction) InitOptions() []kube.InitOpt
- func (*RunnerInterfaceNoAction) IsSwitched(context.Context) (bool, error)
- func (*RunnerInterfaceNoAction) SetNodeInterface(context.Context, *kube.KubernetesClient, ...SetNodeInterfaceOpt) error
- type RunnerInterfaceOpt
- type RunnerInterfaceSSH
- func (r *RunnerInterfaceSSH) Finalize(isError bool)
- func (r *RunnerInterfaceSSH) InitOptions() []kube.InitOpt
- func (r *RunnerInterfaceSSH) IsSwitched(ctx context.Context) (bool, error)
- func (r *RunnerInterfaceSSH) SetNodeInterface(ctx context.Context, client *kube.KubernetesClient, ...) error
- func (r *RunnerInterfaceSSH) WithInitOptions(opts ...kube.InitOpt) *RunnerInterfaceSSH
- func (r *RunnerInterfaceSSH) WithLoopParams(p RunnerInterfaceSSHLoopsParams) *RunnerInterfaceSSH
- type RunnerInterfaceSSHLoopsParams
- type SSHClientOption
- type SSHClientOptions
- type SSHProviderInitializer
- type SSHProviderInitializerWithCleanup
- type SetNodeInterfaceOpt
- type SetNodeInterfaceOpts
- type SimpleKubeProviderInitializer
- type SimpleSSHProviderInitializer
Constants ¶
This section is empty.
Variables ¶
var (
ErrCannotProvideSSHProvider = errors.New("cannot provide ssh provider initializer")
)
var ErrSSHClientCannotProvided = errors.New("cannot provide ssh client")
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) Client ¶
func (p *DefaultKubeProvider) Client(ctx context.Context) (connection.KubeClient, error)
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 ¶
func (p *DefaultKubeProvider) WithLoopsParams(l KubeProviderLoopsParams) *DefaultKubeProvider
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) Client ¶
func (p *DefaultSSHProvider) Client(ctx context.Context) (connection.SSHClient, error)
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 (p *DefaultSSHProvider) WithID(id string) *DefaultSSHProvider
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) Client ¶
func (p *ErrorSSHProvider) Client(context.Context) (connection.SSHClient, error)
func (*ErrorSSHProvider) NewAdditionalClient ¶
func (p *ErrorSSHProvider) NewAdditionalClient(context.Context) (connection.SSHClient, error)
func (*ErrorSSHProvider) NewStandaloneClient ¶
func (p *ErrorSSHProvider) NewStandaloneClient(context.Context, *session.Session, []session.AgentPrivateKey, ...connection.StandaloneClientOpt) (connection.SSHClient, error)
func (*ErrorSSHProvider) SwitchClient ¶
func (p *ErrorSSHProvider) SwitchClient(context.Context, *session.Session, []session.AgentPrivateKey) (connection.SSHClient, error)
func (*ErrorSSHProvider) SwitchToDefault ¶
func (p *ErrorSSHProvider) SwitchToDefault(context.Context) (connection.SSHClient, error)
type ErrorSSHProviderInitializer ¶ added in v0.3.0
type ErrorSSHProviderInitializer struct {
*SimpleSSHProviderInitializer
}
ErrorSSHProviderInitializer provide ErrorSSHProvider this provider returns error for every SSHProvider methods call
func NewErrorSSHProviderInitializer ¶ added in v0.5.0
func NewErrorSSHProviderInitializer(err error) *ErrorSSHProviderInitializer
type FakeKubeProvider ¶
type FakeKubeProvider struct {
// contains filtered or unexported fields
}
func NewFakeKubeProvider ¶
func NewFakeKubeProvider(gvrs ...map[schema.GroupVersionResource]string) *FakeKubeProvider
func (*FakeKubeProvider) Client ¶
func (p *FakeKubeProvider) Client(context.Context) (connection.KubeClient, error)
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 FakeKubeProviderInitializer ¶ added in v0.3.0
type FakeKubeProviderInitializer struct {
*SimpleKubeProviderInitializer
}
func NewFakeKubeProviderInitializer ¶ added in v0.3.0
func NewFakeKubeProviderInitializer(gvrs ...map[schema.GroupVersionResource]string) *FakeKubeProviderInitializer
type KubeProviderInitializer ¶ added in v0.3.0
type KubeProviderInitializer interface {
GetKubeProvider(ctx context.Context) (connection.KubeProvider, error)
}
type KubeProviderInitializerWithCleanup ¶ added in v0.3.0
type KubeProviderInitializerWithCleanup interface {
KubeProviderInitializer
Cleanup(ctx context.Context) error
}
type KubeProviderLoopsParams ¶
type ProvideErrorSSHProviderInitializer ¶ added in v0.5.0
type ProvideErrorSSHProviderInitializer struct {
// contains filtered or unexported fields
}
ProvideErrorSSHProviderInitializer this provider returns error for every GetSSHProvider call for fail fast in GetRunnerInterface func
func NewProvideErrorSSHProviderInitializer ¶ added in v0.5.0
func NewProvideErrorSSHProviderInitializer(err error) *ProvideErrorSSHProviderInitializer
func (*ProvideErrorSSHProviderInitializer) Cleanup ¶ added in v0.5.0
func (i *ProvideErrorSSHProviderInitializer) Cleanup(_ context.Context) error
func (*ProvideErrorSSHProviderInitializer) GetSSHProvider ¶ added in v0.5.0
func (i *ProvideErrorSSHProviderInitializer) GetSSHProvider(_ context.Context) (connection.SSHProvider, error)
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(ctx context.Context, config *kube.Config, sett settings.Settings, sshInitializer SSHProviderInitializer, 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) IsSwitched(context.Context) (bool, error)
func (*RunnerInterfaceNoAction) SetNodeInterface ¶
func (*RunnerInterfaceNoAction) SetNodeInterface(context.Context, *kube.KubernetesClient, ...SetNodeInterfaceOpt) error
type RunnerInterfaceOpt ¶
type RunnerInterfaceOpt func(RunnerInterface)
func RunnerInterfaceWithInitOpts ¶
func RunnerInterfaceWithInitOpts(opts ...kube.InitOpt) RunnerInterfaceOpt
func RunnerInterfaceWithSSHLoopsParams ¶
func RunnerInterfaceWithSSHLoopsParams(p RunnerInterfaceSSHLoopsParams) 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 ¶
func (r *RunnerInterfaceSSH) WithLoopParams(p RunnerInterfaceSSHLoopsParams) *RunnerInterfaceSSH
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 SSHProviderInitializer ¶ added in v0.3.0
type SSHProviderInitializer interface {
GetSSHProvider(ctx context.Context) (connection.SSHProvider, error)
}
type SSHProviderInitializerWithCleanup ¶ added in v0.3.0
type SSHProviderInitializerWithCleanup interface {
SSHProviderInitializer
Cleanup(ctx context.Context) error
}
type SetNodeInterfaceOpt ¶
type SetNodeInterfaceOpt func(opts *SetNodeInterfaceOpts)
func SetNodeInterfaceOptWithNewNodeInterface ¶
func SetNodeInterfaceOptWithNewNodeInterface() SetNodeInterfaceOpt
func SetNodeInterfaceOptWithRunChecks ¶
func SetNodeInterfaceOptWithRunChecks() SetNodeInterfaceOpt
type SetNodeInterfaceOpts ¶
type SimpleKubeProviderInitializer ¶ added in v0.3.0
type SimpleKubeProviderInitializer struct {
// contains filtered or unexported fields
}
func NewSimpleKubeProviderInitializer ¶ added in v0.3.0
func NewSimpleKubeProviderInitializer(provider connection.KubeProvider) *SimpleKubeProviderInitializer
func (*SimpleKubeProviderInitializer) Cleanup ¶ added in v0.3.0
func (i *SimpleKubeProviderInitializer) Cleanup(ctx context.Context) error
func (*SimpleKubeProviderInitializer) GetKubeProvider ¶ added in v0.3.0
func (i *SimpleKubeProviderInitializer) GetKubeProvider(_ context.Context) (connection.KubeProvider, error)
type SimpleSSHProviderInitializer ¶ added in v0.3.0
type SimpleSSHProviderInitializer struct {
// contains filtered or unexported fields
}
func NewSimpleSSHProviderInitializer ¶ added in v0.3.0
func NewSimpleSSHProviderInitializer(provider connection.SSHProvider) *SimpleSSHProviderInitializer
func (*SimpleSSHProviderInitializer) Cleanup ¶ added in v0.3.0
func (i *SimpleSSHProviderInitializer) Cleanup(ctx context.Context) error
func (*SimpleSSHProviderInitializer) GetSSHProvider ¶ added in v0.3.0
func (i *SimpleSSHProviderInitializer) GetSSHProvider(_ context.Context) (connection.SSHProvider, error)