Documentation
¶
Overview ¶
Package clusterprovisioner provides implementations of the Provisioner interface for provisioning clusters in different providers.
Index ¶
- Variables
- type ClusterProvisioner
- type DefaultFactory
- type Factory
- type MockClusterProvisioner
- func (_mock *MockClusterProvisioner) Create(ctx context.Context, name string) error
- func (_mock *MockClusterProvisioner) Delete(ctx context.Context, name string) error
- func (_m *MockClusterProvisioner) EXPECT() *MockClusterProvisioner_Expecter
- func (_mock *MockClusterProvisioner) Exists(ctx context.Context, name string) (bool, error)
- func (_mock *MockClusterProvisioner) List(ctx context.Context) ([]string, error)
- func (_mock *MockClusterProvisioner) Start(ctx context.Context, name string) error
- func (_mock *MockClusterProvisioner) Stop(ctx context.Context, name string) error
- type MockClusterProvisioner_Create_Call
- func (_c *MockClusterProvisioner_Create_Call) Return(err error) *MockClusterProvisioner_Create_Call
- func (_c *MockClusterProvisioner_Create_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Create_Call
- func (_c *MockClusterProvisioner_Create_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Create_Call
- type MockClusterProvisioner_Delete_Call
- func (_c *MockClusterProvisioner_Delete_Call) Return(err error) *MockClusterProvisioner_Delete_Call
- func (_c *MockClusterProvisioner_Delete_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Delete_Call
- func (_c *MockClusterProvisioner_Delete_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Delete_Call
- type MockClusterProvisioner_Exists_Call
- func (_c *MockClusterProvisioner_Exists_Call) Return(b bool, err error) *MockClusterProvisioner_Exists_Call
- func (_c *MockClusterProvisioner_Exists_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Exists_Call
- func (_c *MockClusterProvisioner_Exists_Call) RunAndReturn(run func(ctx context.Context, name string) (bool, error)) *MockClusterProvisioner_Exists_Call
- type MockClusterProvisioner_Expecter
- func (_e *MockClusterProvisioner_Expecter) Create(ctx interface{}, name interface{}) *MockClusterProvisioner_Create_Call
- func (_e *MockClusterProvisioner_Expecter) Delete(ctx interface{}, name interface{}) *MockClusterProvisioner_Delete_Call
- func (_e *MockClusterProvisioner_Expecter) Exists(ctx interface{}, name interface{}) *MockClusterProvisioner_Exists_Call
- func (_e *MockClusterProvisioner_Expecter) List(ctx interface{}) *MockClusterProvisioner_List_Call
- func (_e *MockClusterProvisioner_Expecter) Start(ctx interface{}, name interface{}) *MockClusterProvisioner_Start_Call
- func (_e *MockClusterProvisioner_Expecter) Stop(ctx interface{}, name interface{}) *MockClusterProvisioner_Stop_Call
- type MockClusterProvisioner_List_Call
- func (_c *MockClusterProvisioner_List_Call) Return(strings []string, err error) *MockClusterProvisioner_List_Call
- func (_c *MockClusterProvisioner_List_Call) Run(run func(ctx context.Context)) *MockClusterProvisioner_List_Call
- func (_c *MockClusterProvisioner_List_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockClusterProvisioner_List_Call
- type MockClusterProvisioner_Start_Call
- func (_c *MockClusterProvisioner_Start_Call) Return(err error) *MockClusterProvisioner_Start_Call
- func (_c *MockClusterProvisioner_Start_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Start_Call
- func (_c *MockClusterProvisioner_Start_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Start_Call
- type MockClusterProvisioner_Stop_Call
- func (_c *MockClusterProvisioner_Stop_Call) Return(err error) *MockClusterProvisioner_Stop_Call
- func (_c *MockClusterProvisioner_Stop_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Stop_Call
- func (_c *MockClusterProvisioner_Stop_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Stop_Call
- type MockFactory
- type MockFactory_Create_Call
- func (_c *MockFactory_Create_Call) Return(clusterProvisioner ClusterProvisioner, v any, err error) *MockFactory_Create_Call
- func (_c *MockFactory_Create_Call) Run(run func(ctx context.Context, cluster *v1alpha1.Cluster)) *MockFactory_Create_Call
- func (_c *MockFactory_Create_Call) RunAndReturn(...) *MockFactory_Create_Call
- type MockFactory_Expecter
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedDistribution = errors.New("unsupported distribution")
ErrUnsupportedDistribution is returned when an unsupported distribution is specified.
Functions ¶
This section is empty.
Types ¶
type ClusterProvisioner ¶
type ClusterProvisioner interface {
// Create creates a Kubernetes cluster. If name is non-empty, target that name; otherwise use config defaults.
Create(ctx context.Context, name string) error
// Delete deletes a Kubernetes cluster by name or config default when name is empty.
Delete(ctx context.Context, name string) error
// Start starts a Kubernetes cluster by name or config default when name is empty.
Start(ctx context.Context, name string) error
// Stop stops a Kubernetes cluster by name or config default when name is empty.
Stop(ctx context.Context, name string) error
// List lists all Kubernetes clusters.
List(ctx context.Context) ([]string, error)
// Exists checks if a Kubernetes cluster exists by name or config default when name is empty.
Exists(ctx context.Context, name string) (bool, error)
}
ClusterProvisioner defines methods for managing Kubernetes clusters.
type DefaultFactory ¶
type DefaultFactory struct{}
DefaultFactory implements Factory using the existing CreateClusterProvisioner helper.
func (DefaultFactory) Create ¶
func (DefaultFactory) Create( _ context.Context, cluster *v1alpha1.Cluster, ) (ClusterProvisioner, any, error)
Create selects the correct distribution provisioner for the KSail cluster configuration.
type Factory ¶
type Factory interface {
Create(ctx context.Context, cluster *v1alpha1.Cluster) (ClusterProvisioner, any, error)
}
Factory creates distribution-specific cluster provisioners based on the KSail cluster configuration.
type MockClusterProvisioner ¶
MockClusterProvisioner is an autogenerated mock type for the ClusterProvisioner type
func NewMockClusterProvisioner ¶
func NewMockClusterProvisioner(t interface {
mock.TestingT
Cleanup(func())
}) *MockClusterProvisioner
NewMockClusterProvisioner creates a new instance of MockClusterProvisioner. 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 (*MockClusterProvisioner) Create ¶
func (_mock *MockClusterProvisioner) Create(ctx context.Context, name string) error
Create provides a mock function for the type MockClusterProvisioner
func (*MockClusterProvisioner) Delete ¶
func (_mock *MockClusterProvisioner) Delete(ctx context.Context, name string) error
Delete provides a mock function for the type MockClusterProvisioner
func (*MockClusterProvisioner) EXPECT ¶
func (_m *MockClusterProvisioner) EXPECT() *MockClusterProvisioner_Expecter
func (*MockClusterProvisioner) Exists ¶
Exists provides a mock function for the type MockClusterProvisioner
func (*MockClusterProvisioner) List ¶
func (_mock *MockClusterProvisioner) List(ctx context.Context) ([]string, error)
List provides a mock function for the type MockClusterProvisioner
type MockClusterProvisioner_Create_Call ¶
MockClusterProvisioner_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockClusterProvisioner_Create_Call) Return ¶
func (_c *MockClusterProvisioner_Create_Call) Return(err error) *MockClusterProvisioner_Create_Call
func (*MockClusterProvisioner_Create_Call) Run ¶
func (_c *MockClusterProvisioner_Create_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Create_Call
func (*MockClusterProvisioner_Create_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_Create_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Create_Call
type MockClusterProvisioner_Delete_Call ¶
MockClusterProvisioner_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
func (*MockClusterProvisioner_Delete_Call) Return ¶
func (_c *MockClusterProvisioner_Delete_Call) Return(err error) *MockClusterProvisioner_Delete_Call
func (*MockClusterProvisioner_Delete_Call) Run ¶
func (_c *MockClusterProvisioner_Delete_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Delete_Call
func (*MockClusterProvisioner_Delete_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_Delete_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Delete_Call
type MockClusterProvisioner_Exists_Call ¶
MockClusterProvisioner_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists'
func (*MockClusterProvisioner_Exists_Call) Return ¶
func (_c *MockClusterProvisioner_Exists_Call) Return(b bool, err error) *MockClusterProvisioner_Exists_Call
func (*MockClusterProvisioner_Exists_Call) Run ¶
func (_c *MockClusterProvisioner_Exists_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Exists_Call
func (*MockClusterProvisioner_Exists_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_Exists_Call) RunAndReturn(run func(ctx context.Context, name string) (bool, error)) *MockClusterProvisioner_Exists_Call
type MockClusterProvisioner_Expecter ¶
type MockClusterProvisioner_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClusterProvisioner_Expecter) Create ¶
func (_e *MockClusterProvisioner_Expecter) Create(ctx interface{}, name interface{}) *MockClusterProvisioner_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- name string
func (*MockClusterProvisioner_Expecter) Delete ¶
func (_e *MockClusterProvisioner_Expecter) Delete(ctx interface{}, name interface{}) *MockClusterProvisioner_Delete_Call
Delete is a helper method to define mock.On call
- ctx context.Context
- name string
func (*MockClusterProvisioner_Expecter) Exists ¶
func (_e *MockClusterProvisioner_Expecter) Exists(ctx interface{}, name interface{}) *MockClusterProvisioner_Exists_Call
Exists is a helper method to define mock.On call
- ctx context.Context
- name string
func (*MockClusterProvisioner_Expecter) List ¶
func (_e *MockClusterProvisioner_Expecter) List(ctx interface{}) *MockClusterProvisioner_List_Call
List is a helper method to define mock.On call
- ctx context.Context
func (*MockClusterProvisioner_Expecter) Start ¶
func (_e *MockClusterProvisioner_Expecter) Start(ctx interface{}, name interface{}) *MockClusterProvisioner_Start_Call
Start is a helper method to define mock.On call
- ctx context.Context
- name string
func (*MockClusterProvisioner_Expecter) Stop ¶
func (_e *MockClusterProvisioner_Expecter) Stop(ctx interface{}, name interface{}) *MockClusterProvisioner_Stop_Call
Stop is a helper method to define mock.On call
- ctx context.Context
- name string
type MockClusterProvisioner_List_Call ¶
MockClusterProvisioner_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
func (*MockClusterProvisioner_List_Call) Return ¶
func (_c *MockClusterProvisioner_List_Call) Return(strings []string, err error) *MockClusterProvisioner_List_Call
func (*MockClusterProvisioner_List_Call) Run ¶
func (_c *MockClusterProvisioner_List_Call) Run(run func(ctx context.Context)) *MockClusterProvisioner_List_Call
func (*MockClusterProvisioner_List_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_List_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockClusterProvisioner_List_Call
type MockClusterProvisioner_Start_Call ¶
MockClusterProvisioner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*MockClusterProvisioner_Start_Call) Return ¶
func (_c *MockClusterProvisioner_Start_Call) Return(err error) *MockClusterProvisioner_Start_Call
func (*MockClusterProvisioner_Start_Call) Run ¶
func (_c *MockClusterProvisioner_Start_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Start_Call
func (*MockClusterProvisioner_Start_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_Start_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Start_Call
type MockClusterProvisioner_Stop_Call ¶
MockClusterProvisioner_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*MockClusterProvisioner_Stop_Call) Return ¶
func (_c *MockClusterProvisioner_Stop_Call) Return(err error) *MockClusterProvisioner_Stop_Call
func (*MockClusterProvisioner_Stop_Call) Run ¶
func (_c *MockClusterProvisioner_Stop_Call) Run(run func(ctx context.Context, name string)) *MockClusterProvisioner_Stop_Call
func (*MockClusterProvisioner_Stop_Call) RunAndReturn ¶
func (_c *MockClusterProvisioner_Stop_Call) RunAndReturn(run func(ctx context.Context, name string) error) *MockClusterProvisioner_Stop_Call
type MockFactory ¶
MockFactory is an autogenerated mock type for the Factory type
func NewMockFactory ¶
func NewMockFactory(t interface {
mock.TestingT
Cleanup(func())
}) *MockFactory
NewMockFactory creates a new instance of MockFactory. 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 (*MockFactory) Create ¶
func (_mock *MockFactory) Create(ctx context.Context, cluster *v1alpha1.Cluster) (ClusterProvisioner, any, error)
Create provides a mock function for the type MockFactory
func (*MockFactory) EXPECT ¶
func (_m *MockFactory) EXPECT() *MockFactory_Expecter
type MockFactory_Create_Call ¶
MockFactory_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockFactory_Create_Call) Return ¶
func (_c *MockFactory_Create_Call) Return(clusterProvisioner ClusterProvisioner, v any, err error) *MockFactory_Create_Call
func (*MockFactory_Create_Call) Run ¶
func (_c *MockFactory_Create_Call) Run(run func(ctx context.Context, cluster *v1alpha1.Cluster)) *MockFactory_Create_Call
func (*MockFactory_Create_Call) RunAndReturn ¶
func (_c *MockFactory_Create_Call) RunAndReturn(run func(ctx context.Context, cluster *v1alpha1.Cluster) (ClusterProvisioner, any, error)) *MockFactory_Create_Call
type MockFactory_Expecter ¶
type MockFactory_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFactory_Expecter) Create ¶
func (_e *MockFactory_Expecter) Create(ctx interface{}, cluster interface{}) *MockFactory_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- cluster *v1alpha1.Cluster
Directories
¶
| Path | Synopsis |
|---|---|
|
Package k3dprovisioner contains the K3d cluster provisioner and its client provider interfaces.
|
Package k3dprovisioner contains the K3d cluster provisioner and its client provider interfaces. |
|
Package kindprovisioner provides implementations of the Provisioner interface for provisioning clusters in different providers.
|
Package kindprovisioner provides implementations of the Provisioner interface for provisioning clusters in different providers. |
|
Package clustertestutils provides common test utilities for cluster provisioner testing, including shared test cases and helper functions for standardizing test patterns.
|
Package clustertestutils provides common test utilities for cluster provisioner testing, including shared test cases and helper functions for standardizing test patterns. |