Documentation ¶
Overview ¶
Package pkgfile contains functions for working with KptFile instances.
Index ¶
Constants ¶
const KptFileName = "Kptfile"
KptFileName is the name of the KptFile
Variables ¶
var TypeMeta = yaml.ResourceMeta{ TypeMeta: yaml.TypeMeta{ APIVersion: "kpt.dev/v1alpha1", Kind: KptFileName, }, }
TypeMeta is the TypeMeta for KptFile instances.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Functions ¶
type Functions struct { // AutoRunStarlark will cause starlark functions to automatically be run. AutoRunStarlark bool `yaml:"autoRunStarlark,omitempty"` // StarlarkFunctions is a list of starlark functions to run StarlarkFunctions []StarlarkFunction `yaml:"starlarkFunctions,omitempty"` }
type Git ¶
type Git struct { // Commit is the git commit that the package was fetched at Commit string `yaml:"commit,omitempty"` // Repo is the git repository the package was cloned from. e.g. https:// Repo string `yaml:"repo,omitempty"` // RepoDirectory is the sub directory of the git repository that the package was cloned from Directory string `yaml:"directory,omitempty"` // Ref is the git ref the package was cloned from Ref string `yaml:"ref,omitempty"` }
Git contains information on the origin of packages cloned from a git repository.
type Inventory ¶
type Inventory struct { Namespace string `yaml:"namespace,omitempty"` Name string `yaml:"name,omitempty"` // Unique label to identify inventory object in cluster. InventoryID string `yaml:"inventoryID,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` Annotations map[string]string `yaml:"annotations,omitempty"` }
Inventory encapsulates the parameters for the inventory object. All of the the parameters are required if any are set.
type KptFile ¶
type KptFile struct { yaml.ResourceMeta `yaml:",inline"` // CloneFrom records where the package was originally cloned from Upstream Upstream `yaml:"upstream,omitempty"` // PackageMeta contains information about the package PackageMeta PackageMeta `yaml:"packageMetadata,omitempty"` Dependencies []Dependency `yaml:"dependencies,omitempty"` // OpenAPI contains additional schema for the resources in this package // Uses interface{} instead of Node to work around yaml serialization issues // See https://github.com/go-yaml/yaml/issues/518 and // https://github.com/go-yaml/yaml/issues/575 OpenAPI interface{} `yaml:"openAPI,omitempty"` // Functions contains configuration for running functions Functions Functions `yaml:"functions,omitempty"` // Parameters for inventory object. Inventory Inventory `yaml:"inventory,omitempty"` }
KptFile contains information about a package managed with kpt
func (*KptFile) MergeOpenAPI ¶
MergeOpenAPI adds the OpenAPI definitions from localKf to updatedKf. It takes originalKf as a reference for 3-way merge This function is very complex due to serialization issues with yaml.Node.
type OriginType ¶
type OriginType string
OriginType defines the type of origin for a package
const ( // GitOrigin specifies a package as having been cloned from a git repository GitOrigin OriginType = "git" StdinOrigin OriginType = "stdin" )
type PackageMeta ¶
type PackageMeta struct { // URL is the location of the package. e.g. https://github.com/example/com URL string `yaml:"url,omitempty"` // Email is the email of the package maintainer Email string `yaml:"email,omitempty"` // License is the package license License string `yaml:"license,omitempty"` // Version is the package version Version string `yaml:"version,omitempty"` // Tags can be indexed and are metadata about the package Tags []string `yaml:"tags,omitempty"` // Man is the path to documentation about the package Man string `yaml:"man,omitempty"` // ShortDescription contains a short description of the package. ShortDescription string `yaml:"shortDescription,omitempty"` }
type StarlarkFunction ¶
type Upstream ¶
type Upstream struct { // Type is the type of origin. Type OriginType `yaml:"type,omitempty"` // Git contains information on the origin of packages cloned from a git repository. Git Git `yaml:"git,omitempty"` Stdin Stdin `yaml:"stdin,omitempty"` }
Upstream defines where a package was cloned from