apiextensions-apiserverk8s.io/apiextensions-apiserver/pkg/apiserver/conversion Index | Files

package conversion

import "k8s.io/apiextensions-apiserver/pkg/apiserver/conversion"

Index

Variables

var (
	Metrics = newConversionWebhookMetrics()
)

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 ConversionWebhookErrorType

type ConversionWebhookErrorType string
const (
	ConversionWebhookCallFailure                   ConversionWebhookErrorType = "conversion_webhook_call_failure"
	ConversionWebhookMalformedResponseFailure      ConversionWebhookErrorType = "conversion_webhook_malformed_response_failure"
	ConversionWebhookPartialResponseFailure        ConversionWebhookErrorType = "conversion_webhook_partial_response_failure"
	ConversionWebhookInvalidConvertedObjectFailure ConversionWebhookErrorType = "conversion_webhook_invalid_converted_object_failure"
	ConversionWebhookNoObjectsReturnedFailure      ConversionWebhookErrorType = "conversion_webhook_no_objects_returned_failure"
)

type ConversionWebhookMetrics

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

ConversionWebhookMetrics instruments webhook conversion with prometheus metrics.

func (*ConversionWebhookMetrics) ObserveConversionWebhookFailure

func (m *ConversionWebhookMetrics) ObserveConversionWebhookFailure(ctx context.Context, elapsed time.Duration, errorType ConversionWebhookErrorType)

Observe failure with failure type

func (*ConversionWebhookMetrics) ObserveConversionWebhookSuccess

func (m *ConversionWebhookMetrics) ObserveConversionWebhookSuccess(ctx context.Context, elapsed time.Duration)

Observe successful request

Source Files

converter.go metrics.go nop_converter.go webhook_converter.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
29 packages
Last checked
39 minutes ago

Tools for package owners.