Documentation ¶
Index ¶
- Variables
- type AnnotationSetter
- type FieldPathSetter
- type Function
- type Inventory
- type Kptfile
- func (k *Kptfile) WithInventory(inv Inventory) *Kptfile
- func (k *Kptfile) WithPipeline(functions ...Function) *Kptfile
- func (k *Kptfile) WithUpstream(repo, dir, ref, strategy string) *Kptfile
- func (k *Kptfile) WithUpstreamLock(repo, dir, ref, commit string) *Kptfile
- func (k *Kptfile) WithUpstreamLockRef(repoRef, dir, ref string, index int) *Kptfile
- func (k *Kptfile) WithUpstreamRef(repoRef, dir, ref, strategy string) *Kptfile
- type Pipeline
- type RGFile
- type RemoteSubpackage
- type ReposInfo
- type RootPkg
- func (rp *RootPkg) AllReferencedRepos() []string
- func (rp *RootPkg) Build(path string, pkgName string, reposInfo ReposInfo) error
- func (rp *RootPkg) ExpandPkg(t *testing.T, reposInfo ReposInfo) string
- func (rp *RootPkg) ExpandPkgWithName(t *testing.T, rootName string, reposInfo ReposInfo) string
- func (rp *RootPkg) HasKptfile() bool
- func (rp *RootPkg) WithFile(name, content string) *RootPkg
- func (rp *RootPkg) WithKptfile(kf ...*Kptfile) *RootPkg
- func (rp *RootPkg) WithRGFile(rg *RGFile) *RootPkg
- func (rp *RootPkg) WithRawResource(resourceName, manifest string, mutators ...yaml.Filter) *RootPkg
- func (rp *RootPkg) WithResource(resourceName string, mutators ...yaml.Filter) *RootPkg
- func (rp *RootPkg) WithSubPackages(ps ...*SubPkg) *RootPkg
- type SubPkg
- func (sp *SubPkg) WithFile(name, content string) *SubPkg
- func (sp *SubPkg) WithKptfile(kf ...*Kptfile) *SubPkg
- func (sp *SubPkg) WithRawResource(resourceName, manifest string, mutators ...yaml.Filter) *SubPkg
- func (sp *SubPkg) WithResource(resourceName string, mutators ...yaml.Filter) *SubPkg
- func (sp *SubPkg) WithSubPackages(ps ...*SubPkg) *SubPkg
- type Upstream
- type UpstreamLock
Constants ¶
This section is empty.
Variables ¶
var ( DeploymentResource = "deployment" ConfigMapResource = "configmap" SecretResource = "secret" )
Functions ¶
This section is empty.
Types ¶
type AnnotationSetter ¶
func SetAnnotation ¶
func SetAnnotation(name, value string) AnnotationSetter
SetAnnotation returns a new AnnotationSetters that sets an annotation with the given name and value.
type FieldPathSetter ¶
FieldPathSetter updates the value of the field given by the path.
func SetFieldPath ¶
func SetFieldPath(value string, path ...string) FieldPathSetter
SetFieldPath returns a new FieldPathSetter that updates the property given by the path with the given value.
type Kptfile ¶
type Kptfile struct { Upstream *Upstream UpstreamLock *UpstreamLock Pipeline *Pipeline Inventory *Inventory }
Kptfile represents the Kptfile of a package.
func NewKptfile ¶
func NewKptfile() *Kptfile
func (*Kptfile) WithInventory ¶
func (*Kptfile) WithPipeline ¶
func (*Kptfile) WithUpstream ¶
WithUpstream adds information about the upstream information to the Kptfile. The upstream section of the Kptfile is only added if this information is provided.
func (*Kptfile) WithUpstreamLock ¶
WithUpstreamLock adds upstreamLock information to the Kptfile. If no upstreamLock information is provided,
func (*Kptfile) WithUpstreamLockRef ¶
WithUpstreamLockRef adds upstreamLock information to the Kptfile. But unlike WithUpstreamLock, this function takes a the name to a repo and will resolve the actual path when expanding the package. The commit SHA is also not provided, but rather the index of a commit that will be resolved when expanding the package.
func (*Kptfile) WithUpstreamRef ¶
WithUpstreamRef adds information about the upstream information to the Kptfile. Unlike WithUpstream, this function allows providing just a reference to the repo rather than the actual path. The reference will be resolved to an actual path when the package is written to disk.
type RGFile ¶
type RGFile struct {
Name, Namespace, ID string
}
RGFile represents a minimal resourcegroup.
func (*RGFile) WithInventory ¶
type RemoteSubpackage ¶
type RemoteSubpackage struct { // Name is the name of the remote subpackage. It will be used as the value // for the LocalDir property and also used to resolve the Repo path from // other defined repos. RepoRef string Repo string Directory string Ref string Strategy string LocalDir string }
RemoteSubpackage contains information about remote subpackages that should be listed in the Kptfile.
type RootPkg ¶
type RootPkg struct {
// contains filtered or unexported fields
}
RootPkg is a package without any parent package.
func (*RootPkg) AllReferencedRepos ¶
AllReferencedRepos returns the name of all remote subpackages referenced in the package (including any local subpackages).
func (*RootPkg) Build ¶
Build outputs the current data structure as a set of (nested) package in the provided path.
func (*RootPkg) ExpandPkg ¶
ExpandPkg writes the provided package to disk. The name of the root package will just be set to "base".
func (*RootPkg) ExpandPkgWithName ¶
ExpandPkgWithName writes the provided package to disk and uses the given rootName to set the value of the package directory and the metadata.name field of the root package.
func (*RootPkg) HasKptfile ¶
HasKptfile tells whether the package contains a Kptfile.
func (*RootPkg) WithFile ¶
WithFile configures the package to contain a file with the provided name and the given content.
func (*RootPkg) WithKptfile ¶
WithKptfile configures the current package to have a Kptfile. Only zero or one Kptfiles are accepted.
func (*RootPkg) WithRGFile ¶
WithRGFile configures the current package to have a resourcegroup file.
func (*RootPkg) WithRawResource ¶
WithRawResource configures the package to include the provided resource
func (*RootPkg) WithResource ¶
WithResource configures the package to include the provided resource
func (*RootPkg) WithSubPackages ¶
WithSubPackages adds the provided packages as subpackages to the current package
type SubPkg ¶
type SubPkg struct { Name string // contains filtered or unexported fields }
SubPkg is a subpackage, so it is contained inside another package. The name sets both the name of the directory in which the package is stored and the metadata.name field in the Kptfile (if there is one).
func (*SubPkg) WithFile ¶
WithFile configures the package to contain a file with the provided name and the given content.
func (*SubPkg) WithKptfile ¶
WithKptfile configures the current package to have a Kptfile. Only zero or one Kptfiles are accepted.
func (*SubPkg) WithRawResource ¶
WithRawResource configures the package to include the provided resource
func (*SubPkg) WithResource ¶
WithResource configures the package to include the provided resource
func (*SubPkg) WithSubPackages ¶
WithSubPackages adds the provided packages as subpackages to the current package