package conversion
import "sigs.k8s.io/controller-runtime/pkg/webhook/conversion"
Package conversion provides implementation for CRD conversion webhook that implements handler for version conversion requests for types that are convertible.
See pkg/conversion for interface definitions required to ensure an API Type is convertible.
Index ¶
- func IsConvertible(scheme *runtime.Scheme, obj runtime.Object) (bool, error)
- func NewWebhookHandler(scheme *runtime.Scheme) http.Handler
- type Decoder
- func NewDecoder(scheme *runtime.Scheme) *Decoder
- func (d *Decoder) Decode(content []byte) (runtime.Object, *schema.GroupVersionKind, error)
- func (d *Decoder) DecodeInto(content []byte, into runtime.Object) error
- type PartialImplementationError
Functions ¶
func IsConvertible ¶
IsConvertible determines if given type is convertible or not. For a type to be convertible, the group-kind needs to have a Hub type defined and all non-hub types must be able to convert to/from Hub.
func NewWebhookHandler ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder knows how to decode the contents of a CRD version conversion request into a concrete object. TODO(droot): consider reusing decoder from admission pkg for this.
func NewDecoder ¶
NewDecoder creates a Decoder given the runtime.Scheme
func (*Decoder) Decode ¶
Decode decodes the inlined object.
func (*Decoder) DecodeInto ¶
DecodeInto decodes the inlined object in the into the passed-in runtime.Object.
type PartialImplementationError ¶
type PartialImplementationError struct {
// contains filtered or unexported fields
}
PartialImplementationError represents an error due to partial conversion implementation such as hub without spokes, multiple hubs or spokes without hub.
func (PartialImplementationError) Error ¶
func (e PartialImplementationError) Error() string
Source Files ¶
conversion.go decoder.go
- Version
- v0.21.0 (latest)
- Published
- May 20, 2025
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 24 minutes ago –
Tools for package owners.