Skip to content

Commit

Permalink
fix: don't unnecessarily set API external URL
Browse files Browse the repository at this point in the history
  • Loading branch information
toBeOfUse committed Feb 7, 2025
1 parent 9142412 commit ff5d967
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,16 +544,18 @@ func (c *config) Load(path string, fsys fs.FS) error {
if connString, err := fs.ReadFile(fsys, builder.PoolerUrlPath); err == nil && len(connString) > 0 {
c.Db.Pooler.ConnectionString = string(connString)
}
// Update external api url
apiUrl := url.URL{Host: net.JoinHostPort(c.Hostname,
strconv.FormatUint(uint64(c.Api.Port), 10),
)}
if c.Api.Tls.Enabled {
apiUrl.Scheme = "https"
} else {
apiUrl.Scheme = "http"
}
c.Api.ExternalUrl = apiUrl.String()
if len(c.Api.ExternalUrl) == 0 {
// Update external api url
apiUrl := url.URL{Host: net.JoinHostPort(c.Hostname,
strconv.FormatUint(uint64(c.Api.Port), 10),
)}
if c.Api.Tls.Enabled {
apiUrl.Scheme = "https"
} else {
apiUrl.Scheme = "http"
}
c.Api.ExternalUrl = apiUrl.String()
}
// Update image versions
if version, err := fs.ReadFile(fsys, builder.PostgresVersionPath); err == nil {
if strings.HasPrefix(string(version), "15.") && semver.Compare(string(version[3:]), "1.0.55") >= 0 {
Expand Down

0 comments on commit ff5d967

Please sign in to comment.