-
Notifications
You must be signed in to change notification settings - Fork 288
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
openapi(dm): add openapi conifg in dm-master config file #3836
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-dm-integration-tests |
not sure we plan to turn on it by default or remove it from experimental features. |
ptal @sunzhaoyang |
I prefer to remove from experimental features and turn off by default (for security), if dmctl depend on openapi in the future, perhaps it should be implemented with api authentication. @Ehco1996 @lance6716 |
基于安全考虑,没有认证鉴权的openapi默认不要打开,后续实现了api的认证鉴权后再打开会比较合适 |
so we need add a new config like |
Again, I considered the necessity and safety. @lance6716 Any better advice? |
/hold we are waiting for tidb to come up with a solution to the security issue. |
/unhold update final solution in PR description |
/run-dm-integration-tests |
/run-dm-integration-tests |
dm/dm/master/config.go
Outdated
@@ -313,6 +314,10 @@ func (c *Config) adjust() error { | |||
c.QuotaBackendBytes = quotaBackendBytesLowerBound | |||
} | |||
|
|||
if c.ExperimentalFeatures.OpenAPI { | |||
log.L().Warn("openapi is a GA feature and removed from experimental features, so this configuration will have no affect, please set openapi=true in dm-master config file") |
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.
Should enable OpenAPI if it is upgraded from an old cluster
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.
but how should i do this in code ? do i need to update dm-master's config file for user ? 🙄
or what if user set
openapi = false
[experimental]
openapi = true
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.
what is the expected heavior when enable openapi in v5.3 but forget to add new added config in dm-master after upgrade ? @sunzhaoyang ptal
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.
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.
what is the expected heavior when enable openapi in v5.3 but forget to add new added config in dm-master after upgrade ? @sunzhaoyang ptal
Disabled. He has to enable manually.
@@ -20,6 +20,7 @@ max-request-bytes = 1572864 | |||
auto-compaction-mode = "periodic" | |||
auto-compaction-retention = "1h" | |||
quota-backend-bytes = 2147483648 | |||
openapi = false |
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.
Can we omit the below lines when by get-config at L29? looks so confused.
[experimental]
openapi = false
dm/dm/master/config.go
Outdated
@@ -128,6 +128,7 @@ type Config struct { | |||
AutoCompactionMode string `toml:"auto-compaction-mode" json:"auto-compaction-mode"` | |||
AutoCompactionRetention string `toml:"auto-compaction-retention" json:"auto-compaction-retention"` | |||
QuotaBackendBytes int64 `toml:"quota-backend-bytes" json:"quota-backend-bytes"` | |||
OpenAPI bool `toml:"openapi"` |
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.
json?
@@ -91,7 +91,7 @@ func NewConfig() *Config { | |||
} |
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.
--openapi for command line config?
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.
now i think config file is enough becasue we will enable OpenAPI as default in the feature
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.
I don't think so.
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.
ok added in 0463672
v1-sources-path = "" | ||
ssl-ca = "" | ||
ssl-cert = "" | ||
ssl-key = "" | ||
|
||
[experimental] | ||
openapi = false |
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.
if experimental.openapi==true, still print it? Why not set it to false when adjust?
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.
yes we should adjust this value , added in 0964771
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.
rest LGTM
dm/dm/master/dm-master.toml
Outdated
# some experimental features | ||
[experimental] | ||
openapi = false |
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.
This file used for --print-sample-config, so I prefer to remove these lines.
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.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b469dbf
|
@Ehco1996: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-leak-test |
What problem does this PR solve?
Issue Number: ref #3583
What is changed and how it works?
openapi
for dm-master, default value is falseCheck List
Tests
Code changes
Side effects
Related changes
Release note