-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security: disable plugin in default and persist file in specified dir #7087
Changes from 1 commit
2df55d6
4df65ba
6c6acb9
2107165
2f19cf8
0859671
19ee2e0
31954ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,10 @@ | |
// @Failure 500 {string} string "PD server failed to proceed the request." | ||
// @Router /plugin [post] | ||
func (h *pluginHandler) LoadPlugin(w http.ResponseWriter, r *http.Request) { | ||
if !h.GetScheduleConfig().EnableSchedulePlugin { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PTAL! after curl -X POST 'http://127.0.0.1:2379/pd/api/v1/plugin'
load plugin is disabled, please `make pd-server-plugin` first%
curl -X DELETE 'http://127.0.0.1:2379/pd/api/v1/plugin'
unload plugin is disabled, please `make pd-server-plugin` first% cc @lhy1024 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about |
||
h.rd.JSON(w, http.StatusInternalServerError, errors.New("load plugin failed, please enable plugin first")) | ||
return | ||
} | ||
h.processPluginCommand(w, r, schedule.PluginLoad) | ||
} | ||
|
||
|
@@ -62,6 +66,10 @@ | |
// @Failure 500 {string} string "PD server failed to proceed the request." | ||
// @Router /plugin [delete] | ||
func (h *pluginHandler) UnloadPlugin(w http.ResponseWriter, r *http.Request) { | ||
if !h.GetScheduleConfig().EnableSchedulePlugin { | ||
h.rd.JSON(w, http.StatusInternalServerError, errors.New("unload plugin failed, please enable plugin first")) | ||
return | ||
} | ||
h.processPluginCommand(w, r, schedule.PluginUnload) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to add a release note about the default value changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added.