diff --git a/src/jetstream/repository/console_config/env_lookup.go b/src/jetstream/repository/console_config/env_lookup.go index 8c87844b34..d5d3997200 100644 --- a/src/jetstream/repository/console_config/env_lookup.go +++ b/src/jetstream/repository/console_config/env_lookup.go @@ -104,8 +104,14 @@ func MigrateSetupData(portal interfaces.PortalProxy, configStore Repository) err return err } - if err := migrateConfigSetting(portal.Env(), configStore, "SSO_LOGIN", strconv.FormatBool(config.UseSSO), "false"); err != nil { - return err + // Don't store previous SSO_LOGIN value if it's false. + // SSO_LOGIN was incorrectly being set in previous console config table, this was then transferred over here where the console expects + // previous values to have been explicitly set by user (and as such should take precedents over env vars) + // See https://github.com/cloudfoundry/stratos/issues/4013 + if config.UseSSO == true { + if err := migrateConfigSetting(portal.Env(), configStore, "SSO_LOGIN", strconv.FormatBool(config.UseSSO), "false"); err != nil { + return err + } } // Delete the content form the legacy table