Documentation ¶
Index ¶
- func ReadConstraint(f fs.FS, path string) (*unstructured.Unstructured, error)
- func ReadK8sResources(r io.Reader) ([]*unstructured.Unstructured, error)
- func ReadObject(f fs.FS, path string) (*unstructured.Unstructured, error)
- func ReadSources(filenames []string, images []string, tempDir string) ([]*unstructured.Unstructured, error)
- func ReadTemplate(scheme *runtime.Scheme, f fs.FS, path string) (*templates.ConstraintTemplate, error)
- func ReadUnstructureds(bytes []byte) ([]*unstructured.Unstructured, error)
- func ToTemplate(scheme *runtime.Scheme, u *unstructured.Unstructured) (*templates.ConstraintTemplate, error)
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 ¶
func ToTemplate(scheme *runtime.Scheme, u *unstructured.Unstructured) (*templates.ConstraintTemplate, error)
ToTemplate converts an unstructured template into a versionless ConstraintTemplate struct.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.