Skip to content

rook: apply patch to use jq for ceph osd dump json output#1850

Open
ushitora-anqou wants to merge 1 commit intomainfrom
use-custom-rook
Open

rook: apply patch to use jq for ceph osd dump json output#1850
ushitora-anqou wants to merge 1 commit intomainfrom
use-custom-rook

Conversation

@ushitora-anqou
Copy link
Contributor

@ushitora-anqou ushitora-anqou commented Feb 27, 2026

Note that the rook Docker image has jq installed:

❯ docker run -it --entrypoint=sh ghcr.io/cybozu/rook:1.18.6.1 -c "jq --version"
jq-1.6

cf. ushitora-anqou/rook@7733217

Use jq to fix invalid JSON from ceph osd dump

The ceph osd dump -f json command can output invalid JSON containing
values like "inf" which cannot be parsed by encoding/json. This causes
errors like "invalid character 'i' looking for beginning of value".

Fix this by piping the output through jq, which accepts such invalid
JSON and outputs valid JSON that encoding/json can parse.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the custom rook container build to apply an upstream patch that normalizes ceph osd dump -f json output via jq, avoiding failures when Ceph emits non-JSON numeric tokens like inf.

Changes:

  • Apply a patch to Rook’s GetOSDDump to pipe JSON through jq before unmarshalling.
  • Add an upstream unit test (in the patch) covering both valid JSON and inf-containing output.
  • Bump the image tag from 1.18.6.1 to 1.18.6.2.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
rook/use-jq-for-ceph-osd-dump-json-output.patch Adds jq normalization step to OSD dump parsing and adds a corresponding unit test in the upstream patch.
rook/Dockerfile Applies the new patch during the source build stage.
rook/TAG Bumps the published image version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The ceph osd dump -f json command can output invalid JSON containing
values like "inf" which cannot be parsed by encoding/json. This causes
errors like "invalid character 'i' looking for beginning of value".

Fix this by piping the output through jq, which accepts such invalid
JSON and outputs valid JSON that encoding/json can parse.

Signed-off-by: Ryotaro Banno <ryotaro.banno@gmail.com>
@ushitora-anqou ushitora-anqou marked this pull request as ready for review February 27, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants