Indicate backend encrypted only if encryption is requested (#8508)

This commit is contained in:
Harshavardhana
2019-11-11 18:42:10 -08:00
committed by GitHub
parent aa04f97f95
commit 1027afa853
3 changed files with 13 additions and 14 deletions

View File

@@ -183,7 +183,9 @@ func (a adminAPIHandlers) SetConfigKVHandler(w http.ResponseWriter, r *http.Requ
}
// Make sure to write backend is encrypted
saveConfig(context.Background(), objectAPI, backendEncryptedFile, backendEncryptedMigrationComplete)
if globalConfigEncrypted {
saveConfig(context.Background(), objectAPI, backendEncryptedFile, backendEncryptedMigrationComplete)
}
}
// GetConfigKVHandler - GET /minio/admin/v2/get-config-kv?key={key}
@@ -447,7 +449,9 @@ func (a adminAPIHandlers) SetConfigHandler(w http.ResponseWriter, r *http.Reques
}
// Make sure to write backend is encrypted
saveConfig(context.Background(), objectAPI, backendEncryptedFile, backendEncryptedMigrationComplete)
if globalConfigEncrypted {
saveConfig(context.Background(), objectAPI, backendEncryptedFile, backendEncryptedMigrationComplete)
}
// Reply to the client before restarting minio server.
writeSuccessResponseHeadersOnly(w)