Skip to content

Commit

Permalink
Merge branch 'main' into eleijonmarck/unlink-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
eleijonmarck authored Jan 25, 2024
2 parents 2713bb9 + 7bf19d6 commit a96bcdf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"text/template"
"time"
Expand Down Expand Up @@ -524,9 +525,12 @@ func LoadConfigFS(fsys afero.Fs) error {
if Config.Experimental.S3SecretKey, err = maybeLoadEnv(Config.Experimental.S3SecretKey); err != nil {
return err
}
} else if version, err := afero.ReadFile(fsys, PostgresVersionPath); err == nil && strings.HasPrefix(string(version), "15.") {
index := strings.IndexByte(Pg15Image, ':')
Config.Db.Image = Pg15Image[:index+1] + string(version)
} else if version, err := afero.ReadFile(fsys, PostgresVersionPath); err == nil {
parts := strings.Split(string(version), ".")
if patch, err := strconv.Atoi(parts[len(parts)-1]); err == nil && patch >= 55 && parts[0] == "15" {
index := strings.IndexByte(Pg15Image, ':')
Config.Db.Image = Pg15Image[:index+1] + string(version)
}
}
default:
return errors.Errorf("Failed reading config: Invalid %s: %v.", Aqua("db.major_version"), Config.Db.MajorVersion)
Expand Down

0 comments on commit a96bcdf

Please sign in to comment.