Documentation ¶
Index ¶
- Constants
- func BuildRestMapper(restConfig *rest.Config) (meta.RESTMapper, error)
- func FindGroupVersionResource(from *unstructured.Unstructured, restMapper meta.RESTMapper) (*schema.GroupVersionResource, error)
- func GetMetadata(from *unstructured.Unstructured) map[string]interface{}
- func GetNestedField(obj *unstructured.Unstructured, fields ...string) interface{}
- func GetSpec(obj *unstructured.Unstructured) interface{}
- func ToUnstructured(from runtime.Object) (*unstructured.Unstructured, error)
- func ToUnstructuredResource(from runtime.Object, restMapper meta.RESTMapper) (*unstructured.Unstructured, *schema.GroupVersionResource, error)
- type MutateFn
- type OperationResult
Constants ¶
View Source
const ( MetadataField = "metadata" LabelsField = "labels" )
Variables ¶
This section is empty.
Functions ¶
func BuildRestMapper ¶
func BuildRestMapper(restConfig *rest.Config) (meta.RESTMapper, error)
func FindGroupVersionResource ¶
func FindGroupVersionResource(from *unstructured.Unstructured, restMapper meta.RESTMapper) (*schema.GroupVersionResource, error)
func GetMetadata ¶
func GetMetadata(from *unstructured.Unstructured) map[string]interface{}
func GetNestedField ¶ added in v0.6.0
func GetNestedField(obj *unstructured.Unstructured, fields ...string) interface{}
func GetSpec ¶ added in v0.6.0
func GetSpec(obj *unstructured.Unstructured) interface{}
func ToUnstructured ¶
func ToUnstructured(from runtime.Object) (*unstructured.Unstructured, error)
func ToUnstructuredResource ¶
func ToUnstructuredResource(from runtime.Object, restMapper meta.RESTMapper) (*unstructured.Unstructured, *schema.GroupVersionResource, error)
Types ¶
type MutateFn ¶
type MutateFn func(existing *unstructured.Unstructured) (*unstructured.Unstructured, error)
type OperationResult ¶
type OperationResult string
const ( OperationResultNone OperationResult = "unchanged" OperationResultCreated OperationResult = "created" OperationResultUpdated OperationResult = "updated" )
func CreateOrUpdate ¶
func CreateOrUpdate(client dynamic.ResourceInterface, obj *unstructured.Unstructured, mutate MutateFn) (OperationResult, error)
Click to show internal directories.
Click to hide internal directories.