Documentation ¶
Overview ¶
Package server contains the implementation of a RuntimeSDK webhook server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPort = 9443
DefaultPort is the default port that the webhook server serves.
Functions ¶
This section is empty.
Types ¶
type ExtensionHandler ¶
type ExtensionHandler struct { // Hook is the corresponding hook of the handler. Hook runtimecatalog.Hook // Name is the name of the extension handler. // An extension handler name must be valid in line RFC 1123 Label Names. Name string // HandlerFunc is the handler function. HandlerFunc runtimecatalog.Hook // TimeoutSeconds is the timeout of the extension handler. // If left undefined, this will be defaulted to 10s when processing the answer to the discovery // call for this server. TimeoutSeconds *int32 // FailurePolicy is the failure policy of the extension handler. // If left undefined, this will be defaulted to FailurePolicyFail when processing the answer to the discovery // call for this server. FailurePolicy *runtimehooksv1.FailurePolicy // contains filtered or unexported fields }
ExtensionHandler represents an extension handler.
type Options ¶
type Options struct { // Catalog is the catalog used to handle requests. Catalog *runtimecatalog.Catalog // Port is the port that the webhook server serves at. // It is used to set webhook.Server.Port. Port int // Host is the hostname that the webhook server binds to. // It is used to set webhook.Server.Host. Host string // CertDir is the directory that contains the server key and certificate. // If not set, webhook server would look up the server key and certificate in // {TempDir}/k8s-webhook-server/serving-certs. The server key and certificate // must be named tls.key and tls.crt, respectively. // It is used to set webhook.Server.CertDir. CertDir string }
Options are the options for the Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a runtime webhook server.
func (*Server) AddExtensionHandler ¶
func (s *Server) AddExtensionHandler(handler ExtensionHandler) error
AddExtensionHandler adds an extension handler to the server.
Click to show internal directories.
Click to hide internal directories.