-
Notifications
You must be signed in to change notification settings - Fork 0
Readonly mode #9
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
Conversation
| protected Optional<Response> checkIfReadonly() { | ||
| // Check if the S3Gateway is in read-only mode or not. | ||
| if (getClient().getConfiguration().getBoolean( | ||
| S3GatewayConfigKeys.OZONE_S3G_READONLY, | ||
| S3GatewayConfigKeys.OZONE_S3G_READONLY_DEFAULT)) { | ||
| return Optional.of(Response.status(HttpStatus.SC_METHOD_NOT_ALLOWED). | ||
| header("Allow", "GET,HEAD").build()); | ||
| } | ||
| return Optional.empty(); | ||
| } |
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.
nit: I think throwing newError() here is a more uniform way.
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.
Ah, we need to serve allowed methods because we use 405 error code here. I understand.
| "dir1", null, null, null, null, null); | ||
|
|
||
| Assert.assertEquals(Status.OK.getStatusCode(), response.getStatus()); | ||
| } |
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.
Do we need a test for initializeMultipartUpload here?
(cherry picked from commit 1ad9c8f) Tweak tests
(cherry picked from commit 1ad9c8f) Tweak tests
(cherry picked from commit 1ad9c8f) Tweak tests
(cherry picked from commit 1ad9c8f) Tweak tests
(cherry picked from commit 1ad9c8f) Tweak tests
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
What is the link to the Apache JIRA
(Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)
Please replace this section with the link to the Apache JIRA)
How was this patch tested?
(Please explain how this patch was tested. Ex: unit tests, manual tests)
(If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)