Documentation ¶
Index ¶
- Constants
- func Apply(ctx context.Context, schema map[string]Item, data interface{}, ...)
- func CRUpdateAll(ctx context.Context, image, version string) (updated bool)
- func GHReleases(ctx context.Context, owner, repo string) (stable, latest string, err error)
- func GetPlan(schema map[string]Item, data interface{}) (prettyprint string, err error)
- func PullImage(ctx context.Context, current, release string) (image string, err error)
- func Run(cmd *exec.Cmd, stdin io.Reader) error
- func RunWithRetryNotify(ctx context.Context, cmd *exec.Cmd, stdin io.Reader, maxTime time.Duration, ...) error
- func TagImage(ctx context.Context, image, current, stable string) error
- type Item
Constants ¶
const (
// FSRoot is a relative (to scripts in subfolders) root folder of local filesystem repo to update
FSRoot = "../../../"
)
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(ctx context.Context, schema map[string]Item, data interface{}, prBranchPrefix, prTitle string, prIssue int)
Apply applies concrete update plan (schema + data) to GitHub or local filesystem repo
func CRUpdateAll ¶
CRUpdateAll updates all registries, and returns if at least one got updated.
func GHReleases ¶
GHReleases returns greatest current stable release and greatest latest rc or beta pre-release from GitHub owner/repo repository, and any error occurred. If latest pre-release version is lower than the current stable release, then it will return current stable release for both.
func GetPlan ¶
GetPlan returns concrete plan replacing placeholders in schema with actual data values, returns JSON-formatted representation of the plan and any error occurred.
func PullImage ¶
PullImage checks if current image exists locally, tries to pull it if not, and returns reference image url and any error occurred.
func RunWithRetryNotify ¶
func RunWithRetryNotify(ctx context.Context, cmd *exec.Cmd, stdin io.Reader, maxTime time.Duration, maxRetries uint64) error
RunWithRetryNotify runs command cmd with stdin using exponential backoff for maxTime duration up to maxRetries (negative values will make it ignored), notifies about any intermediary errors and return any final error. similar to pkg/util/retry/retry.go:Expo(), just for commands with params and also with context
Types ¶
type Item ¶
Item defines Content where all occurrences of each Replace map key, corresponding to GitHub TreeEntry.Path and/or local filesystem repo file path (prefixed with FSRoot), would be swapped with its respective actual map value (having placeholders replaced with data), creating a concrete update plan. Replace map keys can use RegExp and map values can use Golang Text Template.