refactor: less quotes

This commit is contained in:
2021-12-20 00:49:36 +01:00
parent 053a06ccba
commit 0a903f041f
5 changed files with 31 additions and 28 deletions

View File

@ -20,11 +20,14 @@ func getImagePath(image string) (string, error) {
if err != nil {
return "", err
}
path := reference.Path(img)
if strings.Contains(path, "library") {
path = strings.Split(path, "/")[1]
}
logrus.Debugf("parsed '%s' from '%s'", path, image)
logrus.Debugf("parsed %s from %s", path, image)
return path, nil
}
@ -46,7 +49,7 @@ Cloud recipe version.
logrus.Fatal(err)
}
logrus.Debugf("checking whether '%s' is already deployed", stackName)
logrus.Debugf("checking whether %s is already deployed", stackName)
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, stackName)
if err != nil {
@ -54,11 +57,11 @@ Cloud recipe version.
}
if deployedVersion == "" {
logrus.Fatalf("failed to determine version of deployed '%s'", app.Name)
logrus.Fatalf("failed to determine version of deployed %s", app.Name)
}
if !isDeployed {
logrus.Fatalf("'%s' is not deployed?", app.Name)
logrus.Fatalf("%s is not deployed?", app.Name)
}
recipeMeta, err := catalogue.GetRecipeMeta(app.Type)
@ -74,7 +77,7 @@ Cloud recipe version.
}
if len(versionsMeta) == 0 {
logrus.Fatalf("could not retrieve deployed version ('%s') from recipe catalogue?", deployedVersion)
logrus.Fatalf("could not retrieve deployed version (%s) from recipe catalogue?", deployedVersion)
}
tableCol := []string{"version", "service", "image", "digest"}

View File

@ -79,7 +79,7 @@ func ValidateRecipeWithPrompt(c *cli.Context) recipe.Recipe {
logrus.Fatal(err)
}
logrus.Debugf("validated '%s' as recipe argument", recipeName)
logrus.Debugf("validated %s as recipe argument", recipeName)
return recipe
}
@ -110,7 +110,7 @@ func ValidateApp(c *cli.Context) config.App {
logrus.Fatal(err)
}
logrus.Debugf("validated '%s' as app argument", appName)
logrus.Debugf("validated %s as app argument", appName)
return app
}
@ -133,7 +133,7 @@ func ValidateDomain(c *cli.Context) (string, error) {
ShowSubcommandHelpAndError(c, errors.New("no domain provided"))
}
logrus.Debugf("validated '%s' as domain argument", domainName)
logrus.Debugf("validated %s as domain argument", domainName)
return domainName, nil
}
@ -175,7 +175,7 @@ func ValidateServer(c *cli.Context) (string, error) {
ShowSubcommandHelpAndError(c, errors.New("no server provided"))
}
logrus.Debugf("validated '%s' as server argument", serverName)
logrus.Debugf("validated %s as server argument", serverName)
return serverName, nil
}

View File

@ -112,7 +112,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
if err != nil {
logrus.Fatal(err)
}
logrus.Debugf("retrieved '%s' from remote registry for '%s'", regVersions, image)
logrus.Debugf("retrieved %s from remote registry for %s", regVersions, image)
if strings.Contains(image, "library") {
// ParseNormalizedNamed prepends 'library' to images like nginx:<tag>,
@ -148,7 +148,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
sort.Sort(tagcmp.ByTagDesc(compatible))
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
}