Documentation ¶
Overview ¶
Package update contains libraries for updating packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PkgHasUpdatedUpstream ¶
PkgHasUpdatedUpstream checks if the the local package has different upstream information than origin.
func ReplaceNonKRMFiles ¶ added in v0.18.0
replaceNonKRMFiles replaces the non KRM files in localDir with the corresponding files in updatedDir, it also deletes non KRM files and sub dirs which are present in localDir and not in updatedDir
Types ¶
type Command ¶
type Command struct { // Pkg captures information about the package that should be updated. Pkg *pkg.Pkg // Ref is the ref to update to Ref string // Strategy is the update strategy to use Strategy kptfilev1.UpdateStrategyType }
Command updates the contents of a local package to a different version.
type FastForwardUpdater ¶
type FastForwardUpdater struct{}
Updater updates a package to a new upstream version.
If the package at pkgPath differs from the upstream ref it was fetch from, then Update will fail without making any changes.
func (FastForwardUpdater) Update ¶
func (u FastForwardUpdater) Update(options UpdateOptions) error
We should try to pull the common code up into the Update command.
type PkgNotGitRepoError ¶
type PkgNotGitRepoError struct {
Path types.UniquePath
}
PkgNotGitRepoError is the error type returned if the package being updated is not inside a git repository.
func (*PkgNotGitRepoError) Error ¶
func (p *PkgNotGitRepoError) Error() string
type PkgRepoDirtyError ¶
type PkgRepoDirtyError struct {
Path types.UniquePath
}
PkgRepoDirtyError is the error type returned if the package being updated contains uncommitted changes.
func (*PkgRepoDirtyError) Error ¶
func (p *PkgRepoDirtyError) Error() string
type ReplaceUpdater ¶
type ReplaceUpdater struct{}
Updater updates a package to a new upstream version.
If the package at pkgPath differs from the upstream ref it was fetch from, then Update will delete the local package. This will wipe all local changes.
func (ReplaceUpdater) Update ¶
func (u ReplaceUpdater) Update(options UpdateOptions) error
type ResourceMergeUpdater ¶
type ResourceMergeUpdater struct{}
ResourceMergeUpdater updates a package by fetching the original and updated source packages, and performing a 3-way merge of the Resources.
func (ResourceMergeUpdater) Update ¶
func (u ResourceMergeUpdater) Update(options UpdateOptions) error
type UpdateOptions ¶
type UpdateOptions struct { // RelPackagePath is the relative path of a subpackage to the root. If the // package is root, the value here will be ".". RelPackagePath string // LocalPath is the absolute path to the package on the local fork. LocalPath string // OriginPath is the absolute path to the package in the on-disk clone // of the origin ref of the repo. OriginPath string // UpdatedPath is the absolute path to the package in the on-disk clone // of the updated ref of the repo. UpdatedPath string // IsRoot is true if the package is the root, i.e. the clones of // updated and origin were fetched based on the information in the // Kptfile from this package. IsRoot bool }
type Updater ¶
type Updater interface {
Update(options UpdateOptions) error
}
Updater updates a local package