conversion

package
v0.28.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 25 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metrics = newWebhookConversionMetrics()
)

Functions

This section is empty.

Types

type CRConverterFactory

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

CRConverterFactory is the factory for all CR converters.

func NewCRConverterFactory

func NewCRConverterFactory(serviceResolver webhook.ServiceResolver, authResolverWrapper webhook.AuthenticationInfoResolverWrapper) (*CRConverterFactory, error)

NewCRConverterFactory creates a new CRConverterFactory

func (*CRConverterFactory) NewConverter

func (m *CRConverterFactory) NewConverter(crd *apiextensionsv1.CustomResourceDefinition) (safe, unsafe runtime.ObjectConvertor, err error)

NewConverter returns a new CR converter based on the conversion settings in crd object.

type WebhookConversionErrorType

type WebhookConversionErrorType string
const (
	WebhookConversionCallFailure                   WebhookConversionErrorType = "webhook_conversion_call_failure"
	WebhookConversionMalformedResponseFailure      WebhookConversionErrorType = "webhook_conversion_malformed_response_failure"
	WebhookConversionPartialResponseFailure        WebhookConversionErrorType = "webhook_conversion_partial_response_failure"
	WebhookConversionInvalidConvertedObjectFailure WebhookConversionErrorType = "webhook_conversion_invalid_converted_object_failure"
	WebhookConversionNoObjectsReturnedFailure      WebhookConversionErrorType = "webhook_conversion_no_objects_returned_failure"
)

type WebhookConversionMetrics

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

WebhookConversionMetrics instruments webhook conversion with prometheus metrics.

func (*WebhookConversionMetrics) ObserveWebhookConversionFailure

func (m *WebhookConversionMetrics) ObserveWebhookConversionFailure(ctx context.Context, elapsed time.Duration, errorType WebhookConversionErrorType)

Observe failure with failure type

func (*WebhookConversionMetrics) ObserveWebhookConversionSuccess

func (m *WebhookConversionMetrics) ObserveWebhookConversionSuccess(ctx context.Context, elapsed time.Duration)

Observe successful request

Jump to

Keyboard shortcuts

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