apiserver

package
v0.22.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminPathPrefix   = "/admin/"
	ExecutionDocument = "execution"
	PerfTraceDocument = "perftrace"
)
View Source
const (
	DCP_RESOURCE_WATCH_TIMEOUT_SECONDS = "DCP_RESOURCE_WATCH_TIMEOUT_SECONDS"
)

Variables

This section is empty.

Functions

func NewAdminHttpHandler

func NewAdminHttpHandler(lifetimeCtx context.Context, runConfig ApiServerRunConfig, log logr.Logger) http.Handler

func RequestApiServerShutdown

func RequestApiServerShutdown(ctx context.Context, restClient *clientgorest.RESTClient) error

Types

type ApiServer

type ApiServer struct {
	// contains filtered or unexported fields
}

func NewApiServer

func NewApiServer(name string, config *kubeconfig.Kubeconfig, logger logr.Logger) *ApiServer

func (*ApiServer) Dispose

func (s *ApiServer) Dispose() error

func (*ApiServer) Name

func (s *ApiServer) Name() string

func (*ApiServer) Run

func (s *ApiServer) Run(runCtx context.Context, runConfig ApiServerRunConfig) (<-chan struct{}, error)

type ApiServerExecutionData

type ApiServerExecutionData struct {
	Status                  ApiServerExecutionStatus `json:"status"`
	ShutdownResourceCleanup ApiServerResourceCleanup `json:"shutdownResourceCleanup,omitempty"`
}

type ApiServerExecutionStatus

type ApiServerExecutionStatus string
const (
	ApiServerRunning           ApiServerExecutionStatus = "Running"
	ApiServerCleaningResources ApiServerExecutionStatus = "CleaningResources"
	ApiServerStopping          ApiServerExecutionStatus = "Stopping"
	ApiServerCleanupComplete   ApiServerExecutionStatus = "CleanupComplete"
)

type ApiServerResourceCleanup

type ApiServerResourceCleanup string
const (
	// Do not perform any cleanup.
	ApiServerResourceCleanupNone ApiServerResourceCleanup = "None"

	// Perform full resource cleanup (default).
	ApiServerResourceCleanupFull ApiServerResourceCleanup = "Full"
)

func (ApiServerResourceCleanup) IsFull

func (rc ApiServerResourceCleanup) IsFull() bool

type ApiServerRunConfig

type ApiServerRunConfig struct {
	// RequestShutdown() is a function that can be called to indicate that the API server should shut down.
	// It should NOT be assumed that this is identical to the cancellation function for the API server run context.
	// The API server will be shut down by cancelling the run context, but that in general
	// happens asynchronously to the call to RequestShutdown().
	// Mandatory, must not be nil.
	RequestShutdown func(ApiServerResourceCleanup)

	// The NotificationSource for sending notifications to clients of the API server (such as the controllers process).
	// NotificationSource is optional.
	NotificationSource notifications.NotificationSource

	// CollectPerfTrace is a function that can be called to collect performance trace data.
	// The duration of the trace is controlled by the passed (cancellable) context.
	// CollectPerfTrace is optional.
	CollectPerfTrace func(context.Context, context.CancelFunc, logr.Logger) error
}

Provides additional dependencies that the API server may need during its execution.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL