fix: trim whitespace on registry property values
When upgrading from an older install of Dokku with the old community registry plugin, newlines could be available in the properties set on disk. Trim them so any usage of the properties continues to work as expected by users.
This commit is contained in:
@@ -16,6 +16,7 @@ func getRegistryServerForApp(appName string) string {
|
||||
if value == "" {
|
||||
value = common.PropertyGet("registry", "--global", "server")
|
||||
}
|
||||
value = strings.TrimSpace(value)
|
||||
|
||||
value = strings.TrimSuffix(value, "/")
|
||||
if value == "hub.docker.com" || value == "docker.io" {
|
||||
@@ -39,6 +40,7 @@ func incrementTagVersion(appName string) (int, error) {
|
||||
tag = "0"
|
||||
}
|
||||
|
||||
tag = strings.TrimSpace(tag)
|
||||
version, err := strconv.Atoi(tag)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("Unable to convert existing tag version (%s) to integer: %v", tag, err)
|
||||
|
||||
Reference in New Issue
Block a user