reader

package
v3.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConstraint

func ReadConstraint(f fs.FS, path string) (*unstructured.Unstructured, error)

func ReadK8sResources

func ReadK8sResources(r io.Reader) ([]*unstructured.Unstructured, error)

ReadK8sResources reads JSON or YAML k8s resources from an io.Reader, decoding them into Unstructured objects and returning those objects as a slice.

func ReadObject

func ReadObject(f fs.FS, path string) (*unstructured.Unstructured, error)

ReadObject reads a file from the filesystem abstraction at the specified path, and returns an unstructured.Unstructured object if the file can be successfully unmarshalled.

func ReadSources

func ReadSources(filenames []string, images []string, tempDir string) ([]*unstructured.Unstructured, error)

func ReadTemplate

func ReadTemplate(scheme *runtime.Scheme, f fs.FS, path string) (*templates.ConstraintTemplate, error)

ReadTemplate reads the contents of the path and returns the ConstraintTemplate it defines. Returns an error if the file does not define a ConstraintTemplate.

func ReadUnstructureds

func ReadUnstructureds(bytes []byte) ([]*unstructured.Unstructured, error)

func ToTemplate

ToTemplate converts an unstructured template into a versionless ConstraintTemplate struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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