lifecycle

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBranchVersion added in v0.8.1

func ExtractBranchVersion(branch string) string

ExtractBranchVersion will extract the branch version from the branch name

Types

type Asset

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

Asset represents an asset with its version and path in the repository

type CheckIfGitIsCleanFunc

type CheckIfGitIsCleanFunc func(debug bool) (bool, error)

CheckIfGitIsCleanFunc is a function type that will be used to check if the git tree is clean

type Dependencies

type Dependencies struct {
	VR *VersionRules
	// contains filtered or unexported fields
}

Dependencies holds the necessary filesystem, assets versions map, version rules and methods to apply the lifecycle rules in the target branch

func InitDependencies

func InitDependencies(rootFs billy.Filesystem, branchVersion string, currentChart string, debug bool) (*Dependencies, error)

InitDependencies will check the filesystem, branch version, git status, initialize the Dependencies struct and populate it. If anything fails the operation will be aborted.

func (*Dependencies) ApplyRules

func (ld *Dependencies) ApplyRules(currentChart string, debug bool) error

ApplyRules will populate all assets versions and paths, sort the versions, and execute make remove for each chart and version. After each chart removal, it will commit the changes in a single commit for all versions of that chart.

type GitAddAndCommitFunc

type GitAddAndCommitFunc func(message string) error

GitAddAndCommitFunc is a function type that will be used to add and commit changes in the git tree

type MakeRemoveFunc

type MakeRemoveFunc func(chart, version string, debug bool) error

MakeRemoveFunc is a function type that will be used to execute make remove

type VersionRules

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

VersionRules will hold all the necessary information to check which assets versions are allowed to be in the repository

func GetVersionRules

func GetVersionRules(branchVersion string, debug bool) (*VersionRules, error)

GetVersionRules will check and convert the provided branch version, create the hard-coded rules for the charts repository and calculate the minimum and maximum versions according to the branch version.

func (*VersionRules) CheckChartVersionForLifecycle added in v0.8.1

func (vr *VersionRules) CheckChartVersionForLifecycle(chartVersion string) bool

CheckChartVersionForLifecycle will Check if the chart version is within the range of the current version:

If the chart version is within the range, return true, otherwise return false

type WalkDirFunc

type WalkDirFunc func(fs billy.Filesystem, dirPath string, doFunc filesystem.RelativePathFunc) error

WalkDirFunc is a function type that will be used to walk through the filesystem

Jump to

Keyboard shortcuts

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