unstruct

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

unstruct has utilities for working with k8s unstructured data

Index

Constants

View Source
const CRD = "CustomResourceDefinition"

Variables

This section is empty.

Functions

func NestedMapSlice

func NestedMapSlice(obj map[string]any, fields ...string) ([]map[string]any, bool, error)

NestedMapSlice returns a copy of []map[string]any value of a nested field. Returns false if value is not found and an error if not a []any or contains non-map items in the slice. If the value is found but not of type []any, this still returns true.

func UnmarshalYamls

func UnmarshalYamls(yamlFiles [][]byte) ([]unstructured.Unstructured, error)

UnmarshalYamls un-marshals the YAML documents in the given file into a slice of unstruct.Unstructureds, one for each CRD. Only returns the YAML files for Kubernetes manifests that are CRDs and ignores others. Returns an error if any document failed to unmarshal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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