Documentation
¶
Index ¶
- Constants
- func SkipBadRead(log logr.Logger, basePath string) kio.LocalPackageSkipFileFunc
- type Dispatcher
- func (d *Dispatcher) ApplyFilteredFuncs(filteredFuncs []*yaml.RNode) error
- func (d *Dispatcher) GetAllFuncs(sourceDir []string) (kio.PackageBuffer, error)
- func (d *Dispatcher) RemoveOverlayOnHydratedFiles(filesToHydrate []string, sourceRoot string) (map[TargetPath]bool, error)
- func (d *Dispatcher) RunOnDir(sourceDir string, functionPaths []string) error
- func (d *Dispatcher) SetFuncPaths(buff kio.PackageBuffer, hydratedPath string, sourceRoot string, ...) error
- func (d *Dispatcher) SortFns(buff kio.PackageBuffer) error
- type TargetPath
Constants ¶
const ( // SourceFunctionPath the source dir key where you can find a function in question SourceFunctionPath = "sourcefunctionpath" // FunctionTargetDir the target dir key for a function to be applied too FunctionTargetDir = "targetdir" )
const (
// KustomizationType the type of kustomization file
KustomizationType = "kustomization.yaml"
)
Variables ¶
This section is empty.
Functions ¶
func SkipBadRead ¶
func SkipBadRead(log logr.Logger, basePath string) kio.LocalPackageSkipFileFunc
SkipBadRead tries to read a file and returns true if there is an error, false otherwise. Used with kio.LocalPackageReader to skip yaml files that aren't parsable by kustomize. mostly copied from kio.readFile: https://github.com/kubernetes-sigs/kustomize/blob/a0c7997b6647d78a9b8f7c2f320bf7efb8256423/kyaml/kio/pkgio_reader.go#L258
Types ¶
type Dispatcher ¶
Dispatcher dispatches to the matching API
func (*Dispatcher) ApplyFilteredFuncs ¶
func (d *Dispatcher) ApplyFilteredFuncs(filteredFuncs []*yaml.RNode) error
ApplyFilteredFuncs will apply all the functions to its specific directory, as
func (*Dispatcher) GetAllFuncs ¶
func (d *Dispatcher) GetAllFuncs(sourceDir []string) (kio.PackageBuffer, error)
GetAllFuncs gets all functions from the supplied source directory
func (*Dispatcher) RemoveOverlayOnHydratedFiles ¶
func (d *Dispatcher) RemoveOverlayOnHydratedFiles(filesToHydrate []string, sourceRoot string) (map[TargetPath]bool, error)
RemoveOverlayOnHydratedFiles will return a map of targetpaths that are separated by their overlay
func (*Dispatcher) RunOnDir ¶
func (d *Dispatcher) RunOnDir(sourceDir string, functionPaths []string) error
RunOnDir dispatches the functionPath on the supplied sourceDirectory
func (*Dispatcher) SetFuncPaths ¶
func (d *Dispatcher) SetFuncPaths(buff kio.PackageBuffer, hydratedPath string, sourceRoot string, leafPaths map[TargetPath]bool) error
SetFuncPaths function adds 2 annotations; sourcefunctionpath that will be the source of where the functionpath lies; targetdir is the target directory we need to apply the function too
func (*Dispatcher) SortFns ¶
func (d *Dispatcher) SortFns(buff kio.PackageBuffer) error
SortFns sorts functions so that functions with the longest paths come first copied from the kustomize library https://github.com/kubernetes-sigs/kustomize/blob/3ebdb3fcef66580417d18f44ac20572469e41fa5/kyaml/runfn/runfn.go#L337
type TargetPath ¶
TargetPath to get target Dir and OverlayName by calling GenerateTargetPath
func GenerateTargetPath ¶
func GenerateTargetPath(sourceBase string, kustomization string) (TargetPath, error)
GenerateTargetPath is a helper function to generate the path where hydrated manifests should be generated. sourceBase base for searching for overlays to generate