map for storing tags

feature/poll-multi-tags
Karolis Rusenas 2018-10-14 22:18:39 +01:00
parent 8276338271
commit 3b65c27f98
2 changed files with 12 additions and 7 deletions

View File

@ -20,8 +20,12 @@ type TrackedImage struct {
Namespace string
Secrets []string
Meta map[string]string // metadata supplied by providers
// a list of pre-release tags, ie: 1.0.0-dev, 1.5.0-prod get translated into
// dev, prod
// SemverPreReleaseTags []string
SemverPreReleaseTags map[string]string
}
func (i TrackedImage) String() string {
return fmt.Sprintf("namespace:%s,image:%s,provider:%s,trigger:%s,sched:%s,secrets:%s", i.Namespace, i.Image.Repository(), i.Provider, i.Trigger, i.PollSchedule, i.Secrets)
return fmt.Sprintf("namespace:%s,image:%s:%s,provider:%s,trigger:%s,sched:%s,secrets:%s,semver:%v", i.Namespace, i.Image.Repository(), i.Image.Tag(), i.Provider, i.Trigger, i.PollSchedule, i.Secrets, i.SemverPreReleaseTags)
}

View File

@ -88,11 +88,12 @@ func GetTrackedImage(i string) *types.TrackedImage {
panic(err)
}
return &types.TrackedImage{
Image: ref,
PollSchedule: "",
Trigger: types.TriggerTypeDefault,
Provider: "",
Namespace: "",
Meta: make(map[string]string),
Image: ref,
PollSchedule: "",
Trigger: types.TriggerTypeDefault,
Provider: "",
Namespace: "",
Meta: make(map[string]string),
SemverPreReleaseTags: make(map[string]string),
}
}