apiextensions-apiserver: k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta Index | Files

package objectmeta

import "k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta"

Index

Package Files

algorithm.go coerce.go validation.go

func Coerce Uses

func Coerce(pth *field.Path, obj interface{}, s *structuralschema.Structural, isResourceRoot, dropInvalidFields bool) *field.Error

Coerce checks types of embedded ObjectMeta and TypeMeta and prunes unknown fields inside the former. It does coerce ObjectMeta and TypeMeta at the root if isResourceRoot is true. If dropInvalidFields is true, fields of wrong type will be dropped.

func GetObjectMeta Uses

func GetObjectMeta(obj map[string]interface{}, dropMalformedFields bool) (*metav1.ObjectMeta, bool, error)

GetObjectMeta does conversion of JSON to ObjectMeta. It first tries json.Unmarshal into a metav1.ObjectMeta type. If that does not work and dropMalformedFields is true, it does field-by-field best-effort conversion throwing away fields which lead to errors.

func SetObjectMeta Uses

func SetObjectMeta(obj map[string]interface{}, objectMeta *metav1.ObjectMeta) error

SetObjectMeta writes back ObjectMeta into a JSON data structure.

func Validate Uses

func Validate(pth *field.Path, obj interface{}, s *structuralschema.Structural, isResourceRoot bool) field.ErrorList

Validate validates embedded ObjectMeta and TypeMeta. It also validate those at the root if isResourceRoot is true.

Package objectmeta imports 12 packages (graph) and is imported by 3 packages. Updated 2019-08-29. Refresh now. Tools for package owners.