OCPBUGS-6086: OpenStack: Force JSON content-type in Swift#6787
Conversation
Some OpenStack object storages respond with `204 No Content` to list requests when there are no containers or objects to list. In these cases, when responding to requests with an `Accept: text/plain` or no `Accept` header, some object storages omit the `content-type` header in their status-204 responses. Now, Gophercloud throws an error when the response does not contain a `content-type` header. With this change, we work around the issue by forcing Gophercloud to request a JSON response from the object storage when listing containers. When passed an `Accept: application/json` header, the server responds with `220 OK` and a `content-type` header in our tests. This solution gives us a fix that is easily backportable because it doesn't require any dependency bump.
|
@pierreprinetti: No Bugzilla bug is referenced in the title of this pull request. DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
@pierreprinetti: This pull request references Jira Issue OCPBUGS-6086, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
/jira refresh |
|
@pierreprinetti: once the present PR merges, I will cherry-pick it on top of release-4.8 in a new PR and assign it to you. DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
@pierreprinetti: This pull request references Jira Issue OCPBUGS-6086, which is valid. The bug has been moved to the POST state. 6 validation(s) were run on this bug
DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
/label backport-risk-assessed |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mandre The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
|
@pierreprinetti: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/assign @eurijon |
|
/label cherry-pick-approved |
|
@pierreprinetti: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-6086 has been moved to the MODIFIED state. DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
@pierreprinetti: new pull request created: #6792 DetailsIn response to this:
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 kubernetes/test-infra repository. |
|
[ART PR BUILD NOTIFIER] This PR has been included in build ose-baremetal-installer-container-v4.9.0-202311250023.p0.g1882c69.assembly.stream for distgit ose-baremetal-installer. |
This is a combined backport of #6628 and #6726
Some OpenStack object storages respond with
204 No Contentto list requests when there are no containers or objects to list. In these cases, when responding to requests with anAccept: text/plainor noAcceptheader, some object storages omit thecontent-typeheader in their status-204 responses.Now, Gophercloud throws an error when the response does not contain a
content-typeheader.With this change, we work around the issue by forcing Gophercloud to request a JSON response from the object storage when listing containers. When passed an
Accept: application/jsonheader, the server responds with220 OKand acontent-typeheader in our tests.This solution gives us a fix that is easily backportable because it doesn't require any dependency bump.