kptfileutil

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKptfile

func DefaultKptfile(name string) *kptfilev1.KptFile

DefaultKptfile returns a new minimal Kptfile.

func Equal

func Equal(kf1, kf2 *kptfilev1.KptFile) (bool, error)

func UpdateKptfile

func UpdateKptfile(localPath, updatedPath, originPath string, updateUpstream bool) error

UpdateKptfile updates the Kptfile in the package specified by localPath with values from the packages specified in updatedPath using the package specified by originPath as the common ancestor. If updateUpstream is true, the values from the upstream and upstreamLock sections will also be copied into local.

func UpdateKptfileWithoutOrigin

func UpdateKptfileWithoutOrigin(localPath, updatedPath string, updateUpstream bool) error

UpdateKptfileWithoutOrigin updates the Kptfile in the package specified by localPath with values from the package specified by updatedPath using a 3-way merge strategy, but where origin does not have any values. If updateUpstream is true, the values from the upstream and upstreamLock sections will also be copied into local.

func UpdateUpstreamLockFromGit

func UpdateUpstreamLockFromGit(path string, spec *git.RepoSpec) error

UpdateUpstreamLockFromGit updates the upstreamLock of the package specified by path by using the values from spec. It will also populate the commit field in upstreamLock using the latest commit of the git repo given by spec.

func ValidateInventory

func ValidateInventory(inv *kptfilev1.Inventory) (bool, error)

ValidateInventory returns true and a nil error if the passed inventory is valid; otherwiste, false and the reason the inventory is not valid is returned. A valid inventory must have a non-empty namespace, name, and id.

func WriteFile

func WriteFile(dir string, k interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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