mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Validate config before saving changes after config reset (#14203)
This commit is contained in:
parent
aaea94a48d
commit
a4be47d7ad
@ -74,6 +74,10 @@ func (a adminAPIHandlers) DelConfigKVHandler(w http.ResponseWriter, r *http.Requ
|
|||||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err = validateConfig(cfg); err != nil {
|
||||||
|
writeCustomErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminConfigBadJSON), err.Error(), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if err = saveServerConfig(ctx, objectAPI, cfg); err != nil {
|
if err = saveServerConfig(ctx, objectAPI, cfg); err != nil {
|
||||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||||
|
@ -82,7 +82,7 @@ func RegisterNotificationTargets(ctx context.Context, cfg config.Config, transpo
|
|||||||
for _, targetID := range targetIDs {
|
for _, targetID := range targetIDs {
|
||||||
if !targetList.Exists(targetID) {
|
if !targetList.Exists(targetID) {
|
||||||
return nil, config.Errorf(
|
return nil, config.Errorf(
|
||||||
"Unable to disable configured targets '%v'",
|
"Unable to disable currently configured targets '%v'",
|
||||||
targetID)
|
targetID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user