mirror of
https://github.com/minio/minio.git
synced 2025-12-02 06:07:51 -05:00
Fix console logger crash in gateway mode (#8525)
This PR also fixes config migration only for credentials and region which are valid and set. Also fix implicit `state="on"` behavior
This commit is contained in:
committed by
kannappanr
parent
1dd38750f7
commit
32c200fe12
@@ -23,6 +23,13 @@ import "github.com/minio/minio/pkg/auth"
|
||||
|
||||
// SetCredentials - One time migration code needed, for migrating from older config to new for server credentials.
|
||||
func SetCredentials(c Config, cred auth.Credentials) {
|
||||
creds, err := auth.CreateCredentials(cred.AccessKey, cred.SecretKey)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !creds.IsValid() {
|
||||
return
|
||||
}
|
||||
c[CredentialsSubSys][Default] = KVS{
|
||||
State: StateOn,
|
||||
Comment: "Settings for credentials, after migrating config",
|
||||
@@ -33,6 +40,9 @@ func SetCredentials(c Config, cred auth.Credentials) {
|
||||
|
||||
// SetRegion - One time migration code needed, for migrating from older config to new for server Region.
|
||||
func SetRegion(c Config, name string) {
|
||||
if name == "" {
|
||||
return
|
||||
}
|
||||
c[RegionSubSys][Default] = KVS{
|
||||
RegionName: name,
|
||||
State: StateOn,
|
||||
|
||||
Reference in New Issue
Block a user