Skip to content

Commit a4be47d

Browse files
authored
Validate config before saving changes after config reset (minio#14203)
1 parent aaea94a commit a4be47d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmd/admin-handlers-config-kv.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ func (a adminAPIHandlers) DelConfigKVHandler(w http.ResponseWriter, r *http.Requ
7474
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
7575
return
7676
}
77+
if err = validateConfig(cfg); err != nil {
78+
writeCustomErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminConfigBadJSON), err.Error(), r.URL)
79+
return
80+
}
7781

7882
if err = saveServerConfig(ctx, objectAPI, cfg); err != nil {
7983
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)

internal/config/notify/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func RegisterNotificationTargets(ctx context.Context, cfg config.Config, transpo
8282
for _, targetID := range targetIDs {
8383
if !targetList.Exists(targetID) {
8484
return nil, config.Errorf(
85-
"Unable to disable configured targets '%v'",
85+
"Unable to disable currently configured targets '%v'",
8686
targetID)
8787
}
8888
}

0 commit comments

Comments
 (0)