Documentation ¶
Overview ¶
Package lifecycle contains the handlers for the lifecycle hooks.
The implementation of the handlers is specifically designed for Cluster API E2E tests use cases. When implementing custom RuntimeExtension, it is only required to expose HandlerFunc with the signature defined in sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1.
Index ¶
- type ExtensionHandlers
- func (m *ExtensionHandlers) DoAfterClusterUpgrade(ctx context.Context, request *runtimehooksv1.AfterClusterUpgradeRequest, ...)
- func (m *ExtensionHandlers) DoAfterControlPlaneInitialized(ctx context.Context, ...)
- func (m *ExtensionHandlers) DoAfterControlPlaneUpgrade(ctx context.Context, request *runtimehooksv1.AfterControlPlaneUpgradeRequest, ...)
- func (m *ExtensionHandlers) DoBeforeClusterCreate(ctx context.Context, request *runtimehooksv1.BeforeClusterCreateRequest, ...)
- func (m *ExtensionHandlers) DoBeforeClusterDelete(ctx context.Context, request *runtimehooksv1.BeforeClusterDeleteRequest, ...)
- func (m *ExtensionHandlers) DoBeforeClusterUpgrade(ctx context.Context, request *runtimehooksv1.BeforeClusterUpgradeRequest, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtensionHandlers ¶ added in v1.3.0
type ExtensionHandlers struct {
// contains filtered or unexported fields
}
ExtensionHandlers provides a common struct shared across the lifecycle hook handlers; this is convenient because in Cluster API's E2E tests all of them are using a controller runtime client and the same set of func to work with the config map where preloaded answers for lifecycle hooks are stored. NOTE: it is not mandatory to use a ExtensionHandlers in custom RuntimeExtension, what is important is to expose HandlerFunc with the signature defined in sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1.
func NewExtensionHandlers ¶ added in v1.3.0
func NewExtensionHandlers(client client.Client) *ExtensionHandlers
NewExtensionHandlers returns a ExtensionHandlers for the lifecycle hooks handlers.
func (*ExtensionHandlers) DoAfterClusterUpgrade ¶ added in v1.3.0
func (m *ExtensionHandlers) DoAfterClusterUpgrade(ctx context.Context, request *runtimehooksv1.AfterClusterUpgradeRequest, response *runtimehooksv1.AfterClusterUpgradeResponse)
DoAfterClusterUpgrade implements the HandlerFunc for the AfterClusterUpgrade hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) DoAfterControlPlaneInitialized ¶ added in v1.3.0
func (m *ExtensionHandlers) DoAfterControlPlaneInitialized(ctx context.Context, request *runtimehooksv1.AfterControlPlaneInitializedRequest, response *runtimehooksv1.AfterControlPlaneInitializedResponse)
DoAfterControlPlaneInitialized implements the HandlerFunc for the AfterControlPlaneInitialized hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) DoAfterControlPlaneUpgrade ¶ added in v1.3.0
func (m *ExtensionHandlers) DoAfterControlPlaneUpgrade(ctx context.Context, request *runtimehooksv1.AfterControlPlaneUpgradeRequest, response *runtimehooksv1.AfterControlPlaneUpgradeResponse)
DoAfterControlPlaneUpgrade implements the HandlerFunc for the AfterControlPlaneUpgrade hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) DoBeforeClusterCreate ¶ added in v1.3.0
func (m *ExtensionHandlers) DoBeforeClusterCreate(ctx context.Context, request *runtimehooksv1.BeforeClusterCreateRequest, response *runtimehooksv1.BeforeClusterCreateResponse)
DoBeforeClusterCreate implements the HandlerFunc for the BeforeClusterCreate hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) DoBeforeClusterDelete ¶ added in v1.3.0
func (m *ExtensionHandlers) DoBeforeClusterDelete(ctx context.Context, request *runtimehooksv1.BeforeClusterDeleteRequest, response *runtimehooksv1.BeforeClusterDeleteResponse)
DoBeforeClusterDelete implements the HandlerFunc for the BeforeClusterDelete hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) DoBeforeClusterUpgrade ¶ added in v1.3.0
func (m *ExtensionHandlers) DoBeforeClusterUpgrade(ctx context.Context, request *runtimehooksv1.BeforeClusterUpgradeRequest, response *runtimehooksv1.BeforeClusterUpgradeResponse)
DoBeforeClusterUpgrade implements the HandlerFunc for the BeforeClusterUpgrade hook. The hook answers with the response stored in a well know config map, thus allowing E2E tests to control the hook behaviour during a test. NOTE: custom RuntimeExtension, must implement the body of this func according to the specific use case.