localizer

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package localizer contains utilities for the command kustomize localize, which is documented under proposals/localize-command or at https://github.com/kubernetes-sigs/kustomize/blob/master/proposals/22-04-localize-command.md

Index

Constants

View Source
const (
	// DstPrefix prefixes the target and ref, if target is remote, in the default localize destination directory name
	DstPrefix = "localized"

	// LocalizeDir is the name of the localize directories used to store remote content in the localize destination
	LocalizeDir = "localized-files"

	// FileSchemeDir is the name of the directory immediately inside LocalizeDir used to store file-schemed repos
	FileSchemeDir = "file-schemed"
)

Variables

This section is empty.

Functions

func NewLoader

func NewLoader(rawTarget string, rawScope string, rawNewDir string, fSys filesys.FileSystem) (*Loader, Args, error)

NewLoader is the factory method for Loader, under localize constraints, at rawTarget. For invalid localize arguments, NewLoader returns an error.

func Run

func Run(target, scope, newDir string, fSys filesys.FileSystem) (string, error)

Run attempts to localize the kustomization root at target with the given localize arguments and returns the path to the created newDir.

Types

type Args

type Args struct {
	// target; local copy if remote
	Target filesys.ConfirmedDir

	// directory that bounds target's local references
	// repo directory of local copy if target is remote
	Scope filesys.ConfirmedDir

	// localize destination
	NewDir filesys.ConfirmedDir
}

Args holds localize arguments

type Loader

type Loader struct {

	// loader at Loader's current directory
	ifc.Loader
	// contains filtered or unexported fields
}

Loader is an ifc.Loader that enforces additional constraints specific to kustomize localize.

func (*Loader) Load

func (ll *Loader) Load(path string) ([]byte, error)

Load returns the contents of path if path is a valid localize file. Otherwise, Load returns an error.

func (*Loader) New

func (ll *Loader) New(path string) (ifc.Loader, error)

New returns a Loader at path if path is a valid localize root. Otherwise, New returns an error.

type PathLocalizeError

type PathLocalizeError struct {
	Path      string
	FileError error
	RootError error
}

func (PathLocalizeError) Error

func (ple PathLocalizeError) Error() string

type ResourceLoadError

type ResourceLoadError struct {
	InlineError error
	FileError   error
}

func (ResourceLoadError) Error

func (rle ResourceLoadError) Error() string

Jump to

Keyboard shortcuts

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