Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoChange ¶
func DoChange(change ChangeRequest) (result bool)
func MatchGlob ¶
MatchGlob accepts the input string and then the glob string, returns "if match" bool
func MatchRegex ¶
MatchRegex accepts a regex pattern then an input string
Types ¶
type ChangeRequest ¶
type ChangeRequest struct { Old string `json:"old"` New string `json:"new"` Time time.Time `json:"time"` PatternValue string `json:"patternValue"` PatternType string `json:"patternType"` Image string `json:"image"` File string `json:"file"` }
ChangeRequest is an object recording what changed and when
func EvaluateIfImageShouldChangeGlob ¶
func EvaluateIfImageShouldChangeGlob( currentTag string, cachedTagList []registry.TagInfo, patternValue string, image string, file string, ) ( intent bool, cr ChangeRequest, )
EvaluateIfImageShouldChangeGlob checks if a currentTag should be updated required: - currentTag (string) - []TagInfo list of tags from cache (candidates to be promoted) - glob-string (all tags must match) returns (intent bool, struct ChangeRecord{}) ChangeRecord? we can record the ChangeRecord in the DB for potential "undo" button (One day) this function will evaluate "created" timestamps to ensure it has the latest match glob tag NOTE: if the currentTag is not indexed in the cache (eg the tag disappeared from docker registry)
it will assume that **every tag is more recent than the current one**
func EvaluateIfImageShouldChangeRegex ¶
func EvaluateIfImageShouldChangeRegex( currentTag string, cachedTagList []registry.TagInfo, patternValue string, image string, file string, ) ( intent bool, cr ChangeRequest, )
EvaluateIfImageShouldChangeRegex checks if a currentTag should be updated required: - currentTag (string) - []TagInfo list of tags from cache (candidates to be promoted) - glob-string (all tags must match) returns (intent bool, struct ChangeRecord{}) ChangeRecord? we can record the ChangeRecord in the DB for potential "undo" button this function will evaluate "created" timestamps to ensure it has the latest match glob tag NOTE: if the currentTag is not indexed in the cache (eg the tag disappeared from docker registry)
it will assume that **every tag is more recent than the current one**
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func (*Daemon) FindDockerImages ¶
FindDockerImages returns sorted and unique list of all docker images Tags are stripped the docker registries must be configured
func (*Daemon) UpdateFileList ¶
UpdateFileList returns a list of files found in the gitoperations repo NOTE: updatePolicies with references to the specific gitRepo are required NOTE2: if it looks like a folder all files found underneath will be included TODO: how does this play with .gitoperations files? we probably want to filter+exclude them here TODO: might want to exclude tarballs and other kind of things also I guess..