Documentation ¶
Index ¶
- Constants
- func Apply(schema map[string]Item, data interface{})
- func CRUpdateAll(ctx context.Context, image, version string) (updated bool)
- func GetImageSHA(image string) (string, error)
- func GetPlan(schema map[string]Item, data interface{}) (plan map[string]Item, prettyprint string, err error)
- func ImageTagsFromDockerHub(repo string) ([]string, error)
- func Loadf(path string) []byte
- func ParseTmpl(text string, data interface{}, name string) (string, error)
- func PullImage(ctx context.Context, current 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 StableVersion(ctx context.Context, owner, repo string) (string, error)
- func TagImage(ctx context.Context, image, current, stable string) error
- type Item
- type Release
- type Response
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 CRUpdateAll ¶
CRUpdateAll updates all registries, and returns if at least one got updated.
func GetImageSHA ¶ added in v1.30.0
GetImageSHA gets the SHA of the provided image
func GetPlan ¶
func GetPlan(schema map[string]Item, data interface{}) (plan map[string]Item, prettyprint string, err error)
GetPlan returns concrete plan replacing placeholders in schema with actual data values, returns JSON-formatted representation of the plan and any error occurred.
func ImageTagsFromDockerHub ¶ added in v1.33.0
ImageTagsFromDockerHub returns the 100 latest image tags from Docker Hub for the provided repository
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
func StableVersion ¶ added in v1.30.0
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.
type Release ¶ added in v1.30.0
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.