-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: support validate volume create config #452
feature: support validate volume create config #452
Conversation
Codecov Report
@@ Coverage Diff @@
## master #452 +/- ##
=========================================
Coverage ? 18.04%
=========================================
Files ? 35
Lines ? 1790
Branches ? 0
=========================================
Hits ? 323
Misses ? 1432
Partials ? 35 Continue to review full report at Codecov.
|
type: "object" | ||
additionalProperties: | ||
type: "string" | ||
minLength: 1 | ||
maxLength: 128 | ||
pattern: "[a-zA-Z0-9][a-zA-Z0-9-_. ]{0,127}" |
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 do not think this is correct. Since in some environment, there are labels like "removeMounts": "/etc/entrypoint.sh"
and "ContainerHnFormat": "aserver{{IpPad .ContainerIp}}.center.et2"
. So we need to add /
, {}
and some others.
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, / is necessary, need to add it.
ec91dd0
to
42a9391
Compare
Moving it to milestone 0.3. |
42a9391
to
30b207d
Compare
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
30b207d
to
d911800
Compare
ping @allencloud CI fails according integration system. If this is flaky test, welcome to track this with profiling an issue. build url: https://travis-ci.org/alibaba/pouch/builds/359753465 |
ping @allencloud |
Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com
1.Describe what this PR did
This PR restricts the validate type Post request config body.
for example the name in VolumeCreateConfig validation:
When the above two aspects has been done, codes in https://github.com/alibaba/pouch/blob/master/apis/server/volume_bridge.go#L23 will work.
2.Does this pull request fix one issue?
none, this is related to issue #443.
3.Describe how you did it
NONE
4.Describe how to verify it
We need to add test cases according to this PR in API
POST /volumes/create
test./cc @Letty5411
5.Special notes for reviews
NONE