versioned

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package versioned provides tools for making sure the objects sent to a webhook are in a version the webhook understands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	admission.Attributes
	OldObject runtime.Object
	Object    runtime.Object
}

Attributes is a wrapper around the original admission attributes. It allows override the internal objects with the versioned ones.

func (Attributes) GetObject

func (v Attributes) GetObject() runtime.Object

GetObject overrides the original GetObjects() and it returns the versioned object.

func (Attributes) GetOldObject

func (v Attributes) GetOldObject() runtime.Object

GetOldObject overrides the original GetOldObjects() and it returns the versioned oldObject.

type Convertor

type Convertor struct {
	Scheme *runtime.Scheme
}

Convertor converts objects to the desired version.

func (Convertor) Convert

func (c Convertor) Convert(in runtime.Object, out runtime.Object) error

Convert converts the in object to the out object and returns an error if the conversion fails.

func (Convertor) ConvertToGVK

func (c Convertor) ConvertToGVK(obj runtime.Object, gvk schema.GroupVersionKind) (runtime.Object, error)

ConvertToGVK converts object to the desired gvk.

func (*Convertor) Validate

func (c *Convertor) Validate() error

Validate checks if the conversion has a scheme.

Jump to

Keyboard shortcuts

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