fieldmanager

package
v0.27.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 21 Imported by: 26

Documentation

Index

Constants

View Source
const InvalidManagedFieldsAfterMutatingAdmissionWarningFormat = "" /* 160-byte string literal not displayed */

InvalidManagedFieldsAfterMutatingAdmissionWarningFormat is the warning that a client receives when a create/update/patch request results in invalid managedFields after going through the admission chain.

Variables

This section is empty.

Functions

func IgnoreManagedFieldsTimestampsTransformer added in v0.25.0

func IgnoreManagedFieldsTimestampsTransformer(
	_ context.Context,
	newObj runtime.Object,
	oldObj runtime.Object,
) (res runtime.Object, err error)

IgnoreManagedFieldsTimestampsTransformer reverts timestamp updates if the non-managed parts of the object are equivalent

func NewManagedFieldsValidatingAdmissionController added in v0.21.0

func NewManagedFieldsValidatingAdmissionController(wrap admission.Interface) admission.Interface

NewManagedFieldsValidatingAdmissionController validates the managedFields after calling the provided admission and resets them to their original state if they got changed to an invalid value

func ValidateManagedFields

func ValidateManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) error

Types

type FieldManager

type FieldManager = internal.FieldManager

FieldManager updates the managed fields and merges applied configurations.

func NewDefaultCRDFieldManager added in v0.17.0

func NewDefaultCRDFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (_ *FieldManager, err error)

NewDefaultCRDFieldManager creates a new FieldManager specifically for CRDs. This allows for the possibility of fields which are not defined in models, as well as having no models defined at all.

func NewDefaultFieldManager added in v0.17.0

func NewDefaultFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (*FieldManager, error)

NewDefaultFieldManager creates a new FieldManager that merges apply requests and update managed fields for other types of requests.

type ResourcePathMappings added in v0.22.0

type ResourcePathMappings map[string]fieldpath.Path

ResourcePathMappings maps a group/version to its replicas path. The assumption is that all the paths correspond to leaf fields.

type ScaleHandler added in v0.22.0

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

ScaleHandler manages the conversion of managed fields between a main resource and the scale subresource

func NewScaleHandler added in v0.22.0

func NewScaleHandler(parentEntries []metav1.ManagedFieldsEntry, groupVersion schema.GroupVersion, mappings ResourcePathMappings) *ScaleHandler

NewScaleHandler creates a new ScaleHandler

func (*ScaleHandler) ToParent added in v0.22.0

func (h *ScaleHandler) ToParent(scaleEntries []metav1.ManagedFieldsEntry) ([]metav1.ManagedFieldsEntry, error)

ToParent merges `scaleEntries` with the entries of the main resource and transforms them accordingly

func (*ScaleHandler) ToSubresource added in v0.22.0

func (h *ScaleHandler) ToSubresource() ([]metav1.ManagedFieldsEntry, error)

ToSubresource filter the managed fields of the main resource and convert them so that they can be handled by scale. For the managed fields that have a replicas path it performs two changes:

  1. APIVersion is changed to the APIVersion of the scale subresource
  2. Replicas path of the main resource is transformed to the replicas path of the scale subresource

type TypeConverter added in v0.20.0

type TypeConverter = internal.TypeConverter

TypeConverter allows you to convert from runtime.Object to typed.TypedValue and the other way around.

func NewDeducedTypeConverter

func NewDeducedTypeConverter() TypeConverter

NewDeducedTypeConverter creates a TypeConverter for CRDs that don't have a schema. It does implement the same interface though (and create the same types of objects), so that everything can still work the same. CRDs are merged with all their fields being "atomic" (lists included).

func NewTypeConverter added in v0.20.0

func NewTypeConverter(openapiSpec *spec.Swagger, preserveUnknownFields bool) (TypeConverter, error)

NewTypeConverter builds a TypeConverter from a proto.Models. This will automatically find the proper version of the object, and the corresponding schema information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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