Documentation ¶
Index ¶
- Constants
- Variables
- func BuildManagerIdentifier(encodedManager *metav1.ManagedFieldsEntry) (manager string, err error)
- func EncodeObjectManagedFields(obj runtime.Object, managed ManagedInterface) error
- func FieldsToSet(f metav1.FieldsV1) (s fieldpath.Set, err error)
- func NewConflictError(conflicts merge.Conflicts) *errors.StatusError
- func NewPathElement(s string) (fieldpath.PathElement, error)
- func PathElementString(pe fieldpath.PathElement) (string, error)
- func RemoveObjectManagedFields(obj runtime.Object)
- func SetToFields(s fieldpath.Set) (f metav1.FieldsV1, err error)
- type AtMostEvery
- type GvkParser
- type ManagedInterface
Constants ¶
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 = ":" )
Variables ¶
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("{}")}
Functions ¶
func BuildManagerIdentifier ¶
func BuildManagerIdentifier(encodedManager *metav1.ManagedFieldsEntry) (manager string, err error)
BuildManagerIdentifier creates a manager identifier string from a ManagedFieldsEntry
func EncodeObjectManagedFields ¶
func EncodeObjectManagedFields(obj runtime.Object, managed ManagedInterface) error
EncodeObjectManagedFields converts and stores the fieldpathManagedFields into the objects ManagedFields
func FieldsToSet ¶
FieldsToSet creates a set paths from an input trie of fields
func NewConflictError ¶
func NewConflictError(conflicts merge.Conflicts) *errors.StatusError
NewConflictError returns an error including details on the requests apply conflicts
func NewPathElement ¶
func NewPathElement(s string) (fieldpath.PathElement, error)
NewPathElement parses a serialized path element
func PathElementString ¶
func PathElementString(pe fieldpath.PathElement) (string, error)
PathElementString serializes a path element
func RemoveObjectManagedFields ¶
RemoveObjectManagedFields removes the ManagedFields from the object before we merge so that it doesn't appear in the ManagedFields recursively.
Types ¶
type AtMostEvery ¶ added in v0.16.11
type AtMostEvery struct {
// contains filtered or unexported fields
}
AtMostEvery will never run the method more than once every specified duration.
func NewAtMostEvery ¶ added in v0.16.11
func NewAtMostEvery(delay time.Duration) *AtMostEvery
NewAtMostEvery creates a new AtMostEvery, that will run the method at most every given duration.
func (*AtMostEvery) Do ¶ added in v0.16.11
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 GvkParser ¶ added in v0.20.0
type GvkParser struct {
// contains filtered or unexported fields
}
GvkParser contains a Parser that allows introspecting the schema.
func NewGVKParser ¶ added in v0.20.0
NewGVKParser builds a GVKParser from a proto.Models. This will automatically find the proper version of the object, and the corresponding schema information.
func (*GvkParser) Type ¶ added in v0.20.0
func (p *GvkParser) Type(gvk schema.GroupVersionKind) *typed.ParseableType
Type returns a helper which can produce objects of the given type. Any errors are deferred until a further function is called.
type ManagedInterface ¶ added in v0.17.0
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 DecodeManagedFields ¶ added in v0.21.0
func DecodeManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (ManagedInterface, error)
DecodeManagedFields converts ManagedFields from the wire format (api format) to the format used by sigs.k8s.io/structured-merge-diff
func NewEmptyManaged ¶ added in v0.16.11
func NewEmptyManaged() ManagedInterface
NewEmptyManaged creates an empty ManagedInterface.
func NewManaged ¶ added in v0.17.0
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.