conversion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const FAILURE = "Failure"
View Source
const SUCCESS = "Success"

Variables

This section is empty.

Functions

func Conversion

func Conversion(htype ConversionHandlerType) *configuration

func SchemeBasedConversion

func SchemeBasedConversion() *configuration

Types

type CRDDeclaration

type CRDDeclaration struct {
	resources.ObjectData
}

func (*CRDDeclaration) Kind

func (this *CRDDeclaration) Kind() webhook.WebhookKind

type Config

type Config struct {
	OmitStorageMigration bool
}

func (*Config) AddOptionsToSet

func (this *Config) AddOptionsToSet(set config.OptionSet)

type ConversionHandlerType

type ConversionHandlerType func(wh webhook.Interface) (Interface, error)

type Definition

type Definition interface {
	GetKind() webhook.WebhookKind
	GetHTTPHandler(wh webhook.Interface) (http.Handler, error)

	Validate(p webhook.Interface) error
}

type HTTPHandler

type HTTPHandler struct {
	logger.LogContext
	// contains filtered or unexported fields
}

HTTPHandler represents each individual webhook.

func (*HTTPHandler) ServeHTTP

func (this *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HTTPHandler) Webhook

func (this *HTTPHandler) Webhook() Interface

type Interface

type Interface interface {
	Handle(log logger.LogContext, version string, obj runtime.RawExtension) (runtime.Object, error)
}

type Request

type Request = api.ConversionRequest

type Response

type Response = api.ConversionResponse

func ErrorResponse

func ErrorResponse(req *Request, code int32, err error) *Response

ErrorResponse creates a new Response for error-handling a request.

type WebhookFunc

type WebhookFunc func(log logger.LogContext, version string, obj runtime.RawExtension) (runtime.Object, error)

WebhookFunc implements Handler interface using a single function.

func (WebhookFunc) Handle

func (this WebhookFunc) Handle(log logger.LogContext, version string, obj runtime.RawExtension) (runtime.Object, error)

Handle process the AdmissionRequest by invoking the underlying function.

func (WebhookFunc) Type

func (this WebhookFunc) Type() ConversionHandlerType

Directories

Path Synopsis
api
v1
Package v1 is the v1 version of the Conversion Review API.
Package v1 is the v1 version of the Conversion Review API.
v1beta1
Package v1beta1 is the v1beta1 version of the API.
Package v1beta1 is the v1beta1 version of the API.

Jump to

Keyboard shortcuts

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