resourcestrategy

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 15

Documentation

Overview

Package resourcestrategy defines interfaces for customizing how resources are converted and stored. DefaultStrategy will automatically call the implemented functions when storing or handling a resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowCreateOnUpdater

type AllowCreateOnUpdater interface {
	// AllowCreateOnUpdate is invoked by the DefaultStrategy
	AllowCreateOnUpdate() bool
}

AllowCreateOnUpdater is invoked by the DefaultStrategy

type AllowUnconditionalUpdater

type AllowUnconditionalUpdater interface {
	// AllowUnconditionalUpdate is invoked by the DefaultStrategy
	AllowUnconditionalUpdate() bool
}

AllowUnconditionalUpdater is invoked by the DefaultStrategy

type Canonicalizer

type Canonicalizer interface {
	// Canonicalize formats the object for storage.  Only applied for the version matching the storage version.
	Canonicalize()
}

Canonicalizer functions are invoked before an object is stored to canonicalize the object's format. If Canonicalize is implemented fr a type, it will be invoked before storing an object of that type for either a create or update.

Canonicalize is only invoked for the type that is the storage version type.

type Converter

type Converter interface {
	// ConvertFromInternal converts an internal version of the object to this object's version
	ConvertFromInternal(internal interface{})

	// ConvertToInternal converts this version of the object to an internal version of the object.
	ConvertToInternal() (internal interface{})
}

Converter defines functions for converting a version of a resource to / from the internal version. Converter functions are called to convert the request version of the object to the handler version -- e.g. if a v1beta1 object is created, and the handler uses a v1alpha1 version, then the v1beta1 will be converted to a v1alpha1 before the handler is called.

type Defaulter

type Defaulter interface {
	// Default defaults unset values on the object.  Defaults are specific to the version.
	Default()
}

Defaulter functions are invoked when deserializing an object. If Default is implemented for a type, the apiserver will use it to perform defaulting for that version before converting it to the handler version. Different versions of a resource may have different Defaulter implementations.

type PrepareForCreater

type PrepareForCreater interface {
	PrepareForCreate(ctx context.Context)
}

PrepareForCreater functions are invoked before an object is stored during creation. If PrepareForCreate is implemented for a type, it will be invoked before creating an object of that type.

PrepareForCreater is only invoked when storing an object and only for the type that is the storage version type.

type PrepareForUpdater

type PrepareForUpdater interface {
	PrepareForUpdate(ctx context.Context, old runtime.Object)
}

PrepareForUpdater functions are invoked before an object is stored during update. If PrepareForCreate is implemented for a type, it will be invoked before updating an object of that type.

PrepareForUpdater is only invoked when storing an object and only for the type that is the storage version type.

type TableConverter

type TableConverter interface {
	ConvertToTable(ctx context.Context, tableOptions runtime.Object) (*metav1.Table, error)
}

TableConverter functions are invoked when printing an object from `kubectl get`.

type ValidateUpdater

type ValidateUpdater interface {
	ValidateUpdate(ctx context.Context, obj runtime.Object) field.ErrorList
}

ValidateUpdater functions are invoked before an object is stored to validate the object during update. If ValidateUpdater is implemented for a type, it will be invoked before updating an object of that type.

type Validater

type Validater interface {
	Validate(ctx context.Context) field.ErrorList
}

Validater functions are invoked before an object is stored to validate the object during creation. If Validate is implemented for a type, it will be invoked before creating an object of that type.

Jump to

Keyboard shortcuts

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