Documentation ¶
Overview ¶
Package topologymutation contains the handlers for the topologymutation webhook.
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 (h *ExtensionHandlers) DiscoverVariables(ctx context.Context, _ *runtimehooksv1.DiscoverVariablesRequest, ...)
- func (h *ExtensionHandlers) GeneratePatches(ctx context.Context, req *runtimehooksv1.GeneratePatchesRequest, ...)
- func (h *ExtensionHandlers) ValidateTopology(ctx context.Context, _ *runtimehooksv1.ValidateTopologyRequest, ...)
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 topology mutation hooks handlers; this is convenient because in Cluster API's E2E tests all of them are using a decoder for working with typed API objects, which makes code easier to read and less error prone than using unstructured or working with raw json/yaml. 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(scheme *runtime.Scheme) *ExtensionHandlers
NewExtensionHandlers returns a new ExtensionHandlers for the topology mutation hook handlers.
func (*ExtensionHandlers) DiscoverVariables ¶ added in v1.4.0
func (h *ExtensionHandlers) DiscoverVariables(ctx context.Context, _ *runtimehooksv1.DiscoverVariablesRequest, resp *runtimehooksv1.DiscoverVariablesResponse)
DiscoverVariables implements the HandlerFunc for the DiscoverVariables hook.
func (*ExtensionHandlers) GeneratePatches ¶ added in v1.3.0
func (h *ExtensionHandlers) GeneratePatches(ctx context.Context, req *runtimehooksv1.GeneratePatchesRequest, resp *runtimehooksv1.GeneratePatchesResponse)
GeneratePatches implements the HandlerFunc for the GeneratePatches hook. The hook adds to the response the patches we are using in Cluster API E2E tests. NOTE: custom RuntimeExtension must implement the body of this func according to the specific use case.
func (*ExtensionHandlers) ValidateTopology ¶ added in v1.3.0
func (h *ExtensionHandlers) ValidateTopology(ctx context.Context, _ *runtimehooksv1.ValidateTopologyRequest, resp *runtimehooksv1.ValidateTopologyResponse)
ValidateTopology implements the HandlerFunc for the ValidateTopology hook. Cluster API E2E currently are just validating the hook gets called. NOTE: custom RuntimeExtension must implement the body of this func according to the specific use case.