controller-runtime: Index | Files

package conversion

import ""

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.


Package Files

conversion.go decoder.go

func IsConvertible Uses

func IsConvertible(scheme *runtime.Scheme, obj runtime.Object) (bool, error)

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.

type Decoder Uses

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 Uses

func NewDecoder(scheme *runtime.Scheme) (*Decoder, error)

NewDecoder creates a Decoder given the runtime.Scheme

func (*Decoder) Decode Uses

func (d *Decoder) Decode(content []byte) (runtime.Object, *schema.GroupVersionKind, error)

Decode decodes the inlined object.

func (*Decoder) DecodeInto Uses

func (d *Decoder) DecodeInto(content []byte, into runtime.Object) error

DecodeInto decodes the inlined object in the into the passed-in runtime.Object.

type PartialImplementationError Uses

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 Uses

func (e PartialImplementationError) Error() string

type Webhook Uses

type Webhook struct {
    // contains filtered or unexported fields

Webhook implements a CRD conversion webhook HTTP handler.

func (*Webhook) InjectScheme Uses

func (wh *Webhook) InjectScheme(s *runtime.Scheme) error

InjectScheme injects a scheme into the webhook, in order to construct a Decoder.

func (*Webhook) ServeHTTP Uses

func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request)

Package conversion imports 11 packages (graph) and is imported by 3 packages. Updated 2019-07-03. Refresh now. Tools for package owners.