-
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
Changes from 6 commits
43acd76
ea5cc00
53273c6
4c20104
da3b8dd
23faf9c
0964771
0463672
b469dbf
f24db80
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 |
---|---|---|
|
@@ -91,7 +91,7 @@ func NewConfig() *Config { | |
} | ||
|
||
type ExperimentalFeatures struct { | ||
OpenAPI bool `toml:"openapi"` | ||
OpenAPI bool `toml:"openapi,omitempty"` // OpenAPI is available in v5.4 as default. | ||
} | ||
|
||
// Config is the configuration for dm-master. | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. json? |
||
|
||
// directory path used to store source config files when upgrading from v1.0.x. | ||
// if this path set, DM-master leader will try to upgrade from v1.0.x to the current version. | ||
|
@@ -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 may have no affect in feature release, please set openapi=true in dm-master config file") | ||
} | ||
|
||
return err | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,9 @@ rpc-timeout = "30s" | |
rpc-rate-burst = 40 | ||
rpc-rate-limit = 10.0 | ||
|
||
# openapi feature | ||
openapi = false | ||
|
||
# some experimental features | ||
[experimental] | ||
openapi = false | ||
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. This file used for --print-sample-config, so I prefer to remove these lines. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,10 @@ 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 commentThe 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.
|
||
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 commentThe 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 commentThe 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.
--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