Skip to content

Commit

Permalink
[CLD-7373] Always overwrite CloudSettings based on service environmen…
Browse files Browse the repository at this point in the history
…t when in production (#26581) (#26582)

Automatic Merge
  • Loading branch information
mattermost-build committed Mar 25, 2024
1 parent f6d3200 commit baf02ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/public/model/config.go
Expand Up @@ -3029,16 +3029,18 @@ type CloudSettings struct {
}

func (s *CloudSettings) SetDefaults() {
if s.CWSURL == nil {
switch GetServiceEnvironment() {
serviceEnvironment := GetServiceEnvironment()
if s.CWSURL == nil || serviceEnvironment == ServiceEnvironmentProduction {
switch serviceEnvironment {
case ServiceEnvironmentProduction:
s.CWSURL = NewString(CloudSettingsDefaultCwsURL)
case ServiceEnvironmentTest, ServiceEnvironmentDev:
s.CWSURL = NewString(CloudSettingsDefaultCwsURLTest)
}
}

if s.CWSAPIURL == nil {
switch GetServiceEnvironment() {
switch serviceEnvironment {
case ServiceEnvironmentProduction:
s.CWSAPIURL = NewString(CloudSettingsDefaultCwsAPIURL)
case ServiceEnvironmentTest, ServiceEnvironmentDev:
Expand Down

0 comments on commit baf02ba

Please sign in to comment.