plugins

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 23 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Used with Go plugins.
	PluginSymbol = "KustomizePlugin"

	// Location of builtins.
	BuiltinPluginPackage = "builtin"

	// ApiVersion of builtins.
	BuiltinPluginApiVersion = BuiltinPluginPackage
)

Variables

Functions

func AbsolutePluginPath

func AbsolutePluginPath(pc *types.PluginConfig, id resid.ResId) string

func ActivePluginConfig

func ActivePluginConfig() *types.PluginConfig

func AddFlagEnablePlugins

func AddFlagEnablePlugins(set *pflag.FlagSet, v *bool)

func DefaultPluginConfig

func DefaultPluginConfig() *types.PluginConfig

func DefaultSrcRoot

func DefaultSrcRoot() (string, error)

DefaultSrcRoot guesses where the user has her ${g}/${v}/$lower(${k})/${k}.go files.

func FileExists

func FileExists(name string) bool

func RecentFileExists

func RecentFileExists(path string) bool

True if file less than 3 minutes old, i.e. not accidentally left over from some earlier build.

Types

type BuiltinPluginType added in v3.2.0

type BuiltinPluginType int
const (
	Unknown BuiltinPluginType = iota
	SecretGenerator
	ConfigMapGenerator
	ReplicaCountTransformer
	NamespaceTransformer
	PatchJson6902Transformer
	PatchStrategicMergeTransformer
	PatchTransformer
	LabelTransformer
	AnnotationsTransformer
	PrefixSuffixTransformer
	ImageTagTransformer
	HashTransformer
	InventoryTransformer
	LegacyOrderTransformer
)

func GetBuiltinPluginType added in v3.2.0

func GetBuiltinPluginType(n string) BuiltinPluginType

func (BuiltinPluginType) String added in v3.2.0

func (i BuiltinPluginType) String() string

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

Compiler creates Go plugin object files.

Source code is read from

${srcRoot}/${g}/${v}/${k}.go

Object code is written to

${objRoot}/${g}/${v}/${k}.so

func NewCompiler

func NewCompiler(srcRoot, objRoot string) *Compiler

NewCompiler returns a new compiler instance.

func (*Compiler) Compile

func (b *Compiler) Compile(g, v, k string) error

Compile reads ${srcRoot}/${g}/${v}/${k}.go

and writes ${objRoot}/${g}/${v}/${k}.so

func (*Compiler) ObjRoot

func (b *Compiler) ObjRoot() string

ObjRoot is root of compilation target tree.

func (*Compiler) SrcRoot

func (b *Compiler) SrcRoot() string

SrcRoot is where to find src.

type ExecPlugin

type ExecPlugin struct {
	// contains filtered or unexported fields
}

ExecPlugin record the name and args of an executable It triggers the executable generator and transformer

func NewExecPlugin

func NewExecPlugin(p string) *ExecPlugin

func (*ExecPlugin) Config

func (p *ExecPlugin) Config(
	ldr ifc.Loader, rf *resmap.Factory, config []byte) error

func (*ExecPlugin) Generate

func (p *ExecPlugin) Generate() (resmap.ResMap, error)

func (*ExecPlugin) Transform

func (p *ExecPlugin) Transform(rm resmap.ResMap) error

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(
	pc *types.PluginConfig, rf *resmap.Factory) *Loader

func (*Loader) LoadGenerator

func (l *Loader) LoadGenerator(
	ldr ifc.Loader, res *resource.Resource) (resmap.Generator, error)

func (*Loader) LoadGenerators

func (l *Loader) LoadGenerators(
	ldr ifc.Loader, rm resmap.ResMap) ([]resmap.Generator, error)

func (*Loader) LoadTransformer

func (l *Loader) LoadTransformer(
	ldr ifc.Loader, res *resource.Resource) (resmap.Transformer, error)

func (*Loader) LoadTransformers

func (l *Loader) LoadTransformers(
	ldr ifc.Loader, rm resmap.ResMap) ([]resmap.Transformer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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