Documentation ¶
Overview ¶
Package api defines a set of Handlers to be used for implementing a fake API server, designed specifically to make Cluster API and the Kubeadm Control Plane provider happy during a stress test (it is not complete or production ready, and it will never be).
Index ¶
- func NewAPIServerHandler(manager inmemoryruntime.Manager, log logr.Logger, ...) http.Handler
- func NewDebugHandler(manager inmemoryruntime.Manager, log logr.Logger, ...) http.Handler
- type DebugInfoProvider
- type Event
- type ResourceGroupResolver
- type WatchEventDispatcher
- func (m *WatchEventDispatcher) OnCreate(resourceGroup string, o client.Object)
- func (m *WatchEventDispatcher) OnDelete(resourceGroup string, o client.Object)
- func (m *WatchEventDispatcher) OnGeneric(resourceGroup string, o client.Object)
- func (m *WatchEventDispatcher) OnUpdate(resourceGroup string, _, o client.Object)
- func (m *WatchEventDispatcher) Run(ctx context.Context, timeout string, w http.ResponseWriter) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIServerHandler ¶
func NewAPIServerHandler(manager inmemoryruntime.Manager, log logr.Logger, resolver ResourceGroupResolver) http.Handler
NewAPIServerHandler returns an http.Handler for a fake API server.
func NewDebugHandler ¶
func NewDebugHandler(manager inmemoryruntime.Manager, log logr.Logger, infoProvider DebugInfoProvider) http.Handler
NewDebugHandler returns an http.Handler for debugging the server.
Types ¶
type DebugInfoProvider ¶
DebugInfoProvider defines the methods the server must implement to provide debug info.
type Event ¶
type Event struct { Type watch.EventType `json:"type,omitempty"` Object runtime.Object `json:"object,omitempty"` }
Event records a lifecycle event for a Kubernetes object.
type ResourceGroupResolver ¶
ResourceGroupResolver defines a func that can identify which workloadCluster/resourceGroup a request targets.
type WatchEventDispatcher ¶
type WatchEventDispatcher struct {
// contains filtered or unexported fields
}
WatchEventDispatcher dispatches events for a single resourceGroup.
func (*WatchEventDispatcher) OnCreate ¶
func (m *WatchEventDispatcher) OnCreate(resourceGroup string, o client.Object)
OnCreate dispatches Create events.
func (*WatchEventDispatcher) OnDelete ¶
func (m *WatchEventDispatcher) OnDelete(resourceGroup string, o client.Object)
OnDelete dispatches Delete events.
func (*WatchEventDispatcher) OnGeneric ¶
func (m *WatchEventDispatcher) OnGeneric(resourceGroup string, o client.Object)
OnGeneric dispatches Generic events.
func (*WatchEventDispatcher) OnUpdate ¶
func (m *WatchEventDispatcher) OnUpdate(resourceGroup string, _, o client.Object)
OnUpdate dispatches Update events.
func (*WatchEventDispatcher) Run ¶
func (m *WatchEventDispatcher) Run(ctx context.Context, timeout string, w http.ResponseWriter) error
Run serves a series of encoded events via HTTP with Transfer-Encoding: chunked.
Directories ¶
Path | Synopsis |
---|---|
Package portforward implements support for implementing a fake port forward service in the api.
|
Package portforward implements support for implementing a fake port forward service in the api. |