file

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KustomizationFileNames = []string{
	"kustomization.yaml",
	"kustomization.yml",
	"Kustomization",
}

KustomizationFileNames represents a list of allowed filenames that kustomize searches for

Functions

This section is empty.

Types

type Context

type Context struct {
	FileSystem afero.Fs
}

func NewContext

func NewContext(fileSystem afero.Fs) *Context

NewContext returns a new context to interact with files

func NewFromFileSystem

func NewFromFileSystem(fileSystem afero.Fs) *Context

NewFromFileSystem creates a context to interact with kustomization files from a provided file system

func (*Context) GetKustomizationFromDirectory

func (c *Context) GetKustomizationFromDirectory(directoryPath string) (*KustomizationFile, error)

GetKustomizationFromDirectory attempts to read a kustomization.yaml file from the given directory

func (*Context) GetResourceFromFile

func (c *Context) GetResourceFromFile(resourcePath string) (*ResourceFile, error)

GetResourceFromFile attempts to read a yaml file from the given file name

type KustomizationFile

type KustomizationFile struct {
	ApiVersion            string   `yaml:"apiVersion"`
	Kind                  string   `yaml:"kind"`
	Resources             []string `yaml:"resources"`
	PatchesStrategicMerge []string `yaml:"patchesStrategicMerge"`
}

KustomizationFile represents a kustomization yaml file

type ResourceFile

type ResourceFile struct {
	ApiVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
}

ResourceFile represents any files except kustomization yaml file

Jump to

Keyboard shortcuts

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