Documentation ¶
Index ¶
- func Parse(pathname string, recursive bool) ([]unstructured.Unstructured, error)
- func UpdateChanged(src, tgt map[string]interface{}) bool
- type Manifest
- type YamlManifest
- func (f *YamlManifest) Apply(spec *unstructured.Unstructured) error
- func (f *YamlManifest) ApplyAll() error
- func (f *YamlManifest) DeepCopyResources() []unstructured.Unstructured
- func (f *YamlManifest) Delete(spec *unstructured.Unstructured) error
- func (f *YamlManifest) DeleteAll() error
- func (f *YamlManifest) Find(apiVersion string, kind string, name string) *unstructured.Unstructured
- func (f *YamlManifest) Get(spec *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (f *YamlManifest) References() []corev1.ObjectReference
- func (f *YamlManifest) ResourceNames() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(pathname string, recursive bool) ([]unstructured.Unstructured, error)
Parse parses YAML files into Unstructured objects.
It supports 5 cases today:
- pathname = path to a file --> parses that file.
- pathname = path to a directory, recursive = false --> parses all files in that directory.
- pathname = path to a directory, recursive = true --> parses all files in that directory and it's descendants
- pathname = url --> fetches the contents of that URL and parses them as YAML.
- pathname = combination of all previous cases, the string can contain multiple records (file, directory or url) separated by comma
func UpdateChanged ¶
We need to preserve the top-level target keys, specifically 'metadata.resourceVersion', 'spec.clusterIP', and any existing entries in a ConfigMap's 'data' field. So we only overwrite fields set in our src resource.
Types ¶
type Manifest ¶
type Manifest interface { // Either updates or creates all resources in the manifest ApplyAll() error // Updates or creates a particular resource Apply(*unstructured.Unstructured) error // Deletes all resources in the manifest DeleteAll() error // Deletes a particular resource Delete(spec *unstructured.Unstructured) error // Returns a deep copy of the matching resource read from the file Find(apiVersion string, kind string, name string) *unstructured.Unstructured // Returns the resource fetched from the api server, nil if not found Get(spec *unstructured.Unstructured) (*unstructured.Unstructured, error) // Returns a deep copy of all resources in the manifest DeepCopyResources() []unstructured.Unstructured // ResourceNames is a convenient list of all the resource names in the manifest ResourceNames() []string // References is a convenient list of all resources in the manifest as object references References() []corev1.ObjectReference }
type YamlManifest ¶
type YamlManifest struct {
// contains filtered or unexported fields
}
func (*YamlManifest) Apply ¶
func (f *YamlManifest) Apply(spec *unstructured.Unstructured) error
func (*YamlManifest) ApplyAll ¶
func (f *YamlManifest) ApplyAll() error
func (*YamlManifest) DeepCopyResources ¶
func (f *YamlManifest) DeepCopyResources() []unstructured.Unstructured
func (*YamlManifest) Delete ¶
func (f *YamlManifest) Delete(spec *unstructured.Unstructured) error
func (*YamlManifest) DeleteAll ¶
func (f *YamlManifest) DeleteAll() error
func (*YamlManifest) Find ¶
func (f *YamlManifest) Find(apiVersion string, kind string, name string) *unstructured.Unstructured
func (*YamlManifest) Get ¶
func (f *YamlManifest) Get(spec *unstructured.Unstructured) (*unstructured.Unstructured, error)
func (*YamlManifest) References ¶
func (f *YamlManifest) References() []corev1.ObjectReference
func (*YamlManifest) ResourceNames ¶
func (f *YamlManifest) ResourceNames() []string
Click to show internal directories.
Click to hide internal directories.