Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions util/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func InitialiseSettings(k8sClient *client.K8sClient) error {
}
var hashedPassword string
newPassword := false
if _, ok := secret.Data[client.SettingAdminPasswordHashKey]; !ok {
if oldPassword, ok := secret.Data[client.ADMIN_PASSWORD]; !ok || len(oldPassword) == 0 {
randBytes := make([]byte, client.InitialPasswordLength)
for i := 0; i < client.InitialPasswordLength; i++ {
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(letters))))
Expand Down Expand Up @@ -123,8 +123,11 @@ func MigrateDexConfigFromAcdToDevtronSecret(k8sClient *client.K8sClient) (bool,
}
}
if _, ok := devtronSecret.Data[client.ADMIN_PASSWORD]; !ok {
devtronSecret.Data[client.ADMIN_PASSWORD] = devtronSecret.Data[client.SettingAdminAcdPasswordKey]
updateRequired = true
oldPassword := devtronSecret.Data[client.SettingAdminAcdPasswordKey]
if len(oldPassword) > 0 {
devtronSecret.Data[client.ADMIN_PASSWORD] = oldPassword
updateRequired = true
}
}

// here create or update devtron secret and migrate and store config for dex
Expand Down