apiserver: k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal Index | Files

package internal

import "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal"


Package Files

atmostevery.go conflict.go fields.go gvkparser.go managedfields.go pathelement.go typeconverter.go versionconverter.go


const (
    // Field indicates that the content of this path element is a field's name
    Field = "f"

    // Value indicates that the content of this path element is a field's value
    Value = "v"

    // Index indicates that the content of this path element is an index in an array
    Index = "i"

    // Key indicates that the content of this path element is a key value map
    Key = "k"

    // Separator separates the type of a path element from the contents
    Separator = ":"


var EmptyFields = func() metav1.FieldsV1 {
    f, err := SetToFields(*fieldpath.NewSet())
    if err != nil {
        panic("should never happen")
    return f

EmptyFields represents a set with no paths It looks like metav1.Fields{Raw: []byte("{}")}

func BuildManagerIdentifier Uses

func BuildManagerIdentifier(encodedManager *metav1.ManagedFieldsEntry) (manager string, err error)

BuildManagerIdentifier creates a manager identifier string from a ManagedFieldsEntry

func EncodeObjectManagedFields Uses

func EncodeObjectManagedFields(obj runtime.Object, managed ManagedInterface) error

EncodeObjectManagedFields converts and stores the fieldpathManagedFields into the objects ManagedFields

func FieldsToSet Uses

func FieldsToSet(f metav1.FieldsV1) (s fieldpath.Set, err error)

FieldsToSet creates a set paths from an input trie of fields

func NewCRDVersionConverter Uses

func NewCRDVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter

NewCRDVersionConverter builds a VersionConverter for CRDs from a TypeConverter and an ObjectConvertor.

func NewConflictError Uses

func NewConflictError(conflicts merge.Conflicts) *errors.StatusError

NewConflictError returns an error including details on the requests apply conflicts

func NewPathElement Uses

func NewPathElement(s string) (fieldpath.PathElement, error)

NewPathElement parses a serialized path element

func NewVersionConverter Uses

func NewVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter

NewVersionConverter builds a VersionConverter from a TypeConverter and an ObjectConvertor.

func PathElementString Uses

func PathElementString(pe fieldpath.PathElement) (string, error)

PathElementString serializes a path element

func RemoveObjectManagedFields Uses

func RemoveObjectManagedFields(obj runtime.Object)

RemoveObjectManagedFields removes the ManagedFields from the object before we merge so that it doesn't appear in the ManagedFields recursively.

func SetToFields Uses

func SetToFields(s fieldpath.Set) (f metav1.FieldsV1, err error)

SetToFields creates a trie of fields from an input set of paths

type AtMostEvery Uses

type AtMostEvery struct {
    // contains filtered or unexported fields

AtMostEvery will never run the method more than once every specified duration.

func NewAtMostEvery Uses

func NewAtMostEvery(delay time.Duration) *AtMostEvery

NewAtMostEvery creates a new AtMostEvery, that will run the method at most every given duration.

func (*AtMostEvery) Do Uses

func (s *AtMostEvery) Do(fn func()) bool

Do will run the method if enough time has passed, and return true. Otherwise, it does nothing and returns false.

type DeducedTypeConverter Uses

type DeducedTypeConverter struct{}

DeducedTypeConverter is 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).

Note that this is not going to be sufficient for converting to/from CRDs that have a schema defined (we don't support that schema yet). TODO(jennybuckley): Use the schema provided by a CRD if it exists.

func (DeducedTypeConverter) ObjectToTyped Uses

func (DeducedTypeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error)

ObjectToTyped converts an object into a TypedValue with a "deduced type".

func (DeducedTypeConverter) TypedToObject Uses

func (DeducedTypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error)

TypedToObject transforms the typed value into a runtime.Object. That is not specific to deduced type.

type ManagedInterface Uses

type ManagedInterface interface {
    // Fields gets the fieldpath.ManagedFields.
    Fields() fieldpath.ManagedFields

    // Times gets the timestamps associated with each operation.
    Times() map[string]*metav1.Time

ManagedInterface groups a fieldpath.ManagedFields together with the timestamps associated with each operation.

func DecodeObjectManagedFields Uses

func DecodeObjectManagedFields(from []metav1.ManagedFieldsEntry) (ManagedInterface, error)

DecodeObjectManagedFields extracts and converts the objects ManagedFields into a fieldpath.ManagedFields.

func NewEmptyManaged Uses

func NewEmptyManaged() ManagedInterface

NewEmptyManaged creates an empty ManagedInterface.

func NewManaged Uses

func NewManaged(f fieldpath.ManagedFields, t map[string]*metav1.Time) ManagedInterface

NewManaged creates a ManagedInterface from a fieldpath.ManagedFields and the timestamps associated with each operation.

type TypeConverter Uses

type TypeConverter interface {
    ObjectToTyped(runtime.Object) (*typed.TypedValue, error)
    TypedToObject(*typed.TypedValue) (runtime.Object, error)

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

func NewTypeConverter Uses

func NewTypeConverter(models proto.Models, 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.

Package internal imports 21 packages (graph) and is imported by 1 packages. Updated 2020-06-20. Refresh now. Tools for package owners.