refactor: less quotes

This commit is contained in:
decentral1se 2021-12-20 00:15:55 +01:00
parent 398deec272
commit 053a06ccba
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 8 additions and 8 deletions

View File

@ -122,7 +122,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
} }
semverLikeTag := true semverLikeTag := true
if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) { if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) {
logrus.Debugf("'%s' not considered semver-like", img.(reference.NamedTagged).Tag()) logrus.Debugf("%s not considered semver-like", img.(reference.NamedTagged).Tag())
semverLikeTag = false semverLikeTag = false
} }
@ -130,7 +130,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
if err != nil && semverLikeTag { if err != nil && semverLikeTag {
logrus.Fatal(err) logrus.Fatal(err)
} }
logrus.Debugf("parsed '%s' for '%s'", tag, service.Name) logrus.Debugf("parsed %s for %s", tag, service.Name)
var compatible []tagcmp.Tag var compatible []tagcmp.Tag
for _, regVersion := range regVersions { for _, regVersion := range regVersions {
other, err := tagcmp.Parse(regVersion.Name) other, err := tagcmp.Parse(regVersion.Name)
@ -143,12 +143,12 @@ You may invoke this command in "wizard" mode and be prompted for input:
} }
} }
logrus.Debugf("detected potential upgradable tags '%s' for '%s'", compatible, service.Name) logrus.Debugf("detected potential upgradable tags %s for %s", compatible, service.Name)
sort.Sort(tagcmp.ByTagDesc(compatible)) sort.Sort(tagcmp.ByTagDesc(compatible))
if len(compatible) == 0 && semverLikeTag { if len(compatible) == 0 && semverLikeTag {
logrus.Info(fmt.Sprintf("no new versions available for '%s', '%s' is the latest", image, tag)) logrus.Info(fmt.Sprintf("no new versions available for %s, %s' is the latest", image, tag))
continue // skip on to the next tag and don't update any compose files continue // skip on to the next tag and don't update any compose files
} }
@ -165,7 +165,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
} }
} }
logrus.Debugf("detected compatible upgradable tags '%s' for '%s'", compatibleStrings, service.Name) logrus.Debugf("detected compatible upgradable tags %s for %s", compatibleStrings, service.Name)
var upgradeTag string var upgradeTag string
_, ok := servicePins[service.Name] _, ok := servicePins[service.Name]
@ -205,14 +205,14 @@ You may invoke this command in "wizard" mode and be prompted for input:
} }
} }
if upgradeTag == "" { if upgradeTag == "" {
logrus.Warnf("not upgrading from '%s' to '%s' for '%s', because the upgrade type is more serious than what user wants.", tag.String(), compatible[0].String(), image) logrus.Warnf("not upgrading from %s to %s for %s, because the upgrade type is more serious than what user wants.", tag.String(), compatible[0].String(), image)
continue continue
} }
} else { } else {
msg := fmt.Sprintf("upgrade to which tag? (service: %s, tag: %s)", service.Name, tag) msg := fmt.Sprintf("upgrade to which tag? (service: %s, tag: %s)", service.Name, tag)
if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) { if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) {
tag := img.(reference.NamedTagged).Tag() tag := img.(reference.NamedTagged).Tag()
logrus.Warning(fmt.Sprintf("unable to determine versioning semantics of '%s', listing all tags", tag)) logrus.Warning(fmt.Sprintf("unable to determine versioning semantics of %s, listing all tags", tag))
msg = fmt.Sprintf("upgrade to which tag? (service: %s, tag: %s)", service.Name, tag) msg = fmt.Sprintf("upgrade to which tag? (service: %s, tag: %s)", service.Name, tag)
compatibleStrings = []string{} compatibleStrings = []string{}
for _, regVersion := range regVersions { for _, regVersion := range regVersions {
@ -232,7 +232,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
if err := recipe.UpdateTag(image, upgradeTag); err != nil { if err := recipe.UpdateTag(image, upgradeTag); err != nil {
logrus.Fatal(err) logrus.Fatal(err)
} }
logrus.Infof("tag upgraded from '%s' to '%s' for '%s'", tag.String(), upgradeTag, image) logrus.Infof("tag upgraded from %s to %s for %s", tag.String(), upgradeTag, image)
} }
return nil return nil