Do not show image's encryption algorithm in "namespace list" #2078
In protobuf, removing encryption_algorithm is fine, but reusing its field number (25) and renumbering the subsequent fields (encryption_entries, degraded, pinned) breaks wire compatibility. A new client will no longer be able to read encryption_entries from an older gateway (still sending it as field 26), and older clients will misinterpret/ignore the shifted fields. Keep the existing field numbers for the remaining fields and reserve field number 25 (and the name) so older gateways' encryption_algorithm is ignored without breaking encryption_entries decoding, then regenerate generated stubs.
This test no longer validates the PR's behavior change. It should still run namespace list --format json and assert the encryption_algorithm field is absent (not just stop checking it), otherwise regressions in the CLI output won't be caught.
This test should assert that namespace list --format json no longer includes the encryption_algorithm field (for server A), otherwise the change isn't actually verified.
This issue also appears on line 1255 of the same file.
To ensure the encryption algorithm is no longer exposed by namespace list --format json, add an explicit assertion that the encryption_algorithm field is not present in the output (for server A).
This issue also appears on line 1177 of the same file.
Pull request overview
Removes the RBD image encryption algorithm from namespace list output, aligning with #2077’s requirement that the algorithm is generally unknowable after image creation.
Changes:
encryption_algorithm in the list_namespaces gRPC response (namespace_cli).namespace_cli.encryption_algorithm.namespace list JSON.Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
| ---- | ----------- |
| control/grpc.py | Removes computation/propagation of encryption_algorithm from list_namespaces response objects. |
| control/proto/gateway.proto | Drops namespace_cli.encryption_algorithm and renumbers subsequent fields (compatibility concern). |
| lib/go/nvmeof/gateway.pb.go | Regenerated Go protobuf output reflecting the updated namespace_cli message. |
| tests/test_rbd_encrypt.py | Removes checks that namespace list --format json prints encryption_algorithm (needs explicit absence assertions). |
<details>
<summary>Files not reviewed (1)</summary>
lib/go/nvmeof/gateway.pb.go: Generated file
</details>
<details>
<summary>Suppressed comments (2)</summary>
tests/test_rbd_encrypt.py:1181
To ensure the encryption algorithm is no longer exposed by namespace list --format json, add an explicit assertion that the encryption_algorithm field is not present in the output (for server B).
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
tests/test_rbd_encrypt.py:1259
namespace list --format json no longer includes the encryption_algorithm field (for server B), otherwise the change isn't actually verified. cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
</details>
---
💡 <a href="/ceph/ceph-nvmeof/new/devel?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>
changed
changed
changed
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
<details>
<summary>Files not reviewed (1)</summary>
lib/go/nvmeof/gateway.pb.go: Generated file
</details>
<details>
<summary>Suppressed comments (3)</summary>
tests/test_rbd_encrypt.py:1262
The portB namespace list --format json output is no longer checked for absence of encryption_algorithm. Add a negative assertion here as well so this test validates the behavior across both gateways.
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
caplog.clear()
control/proto/gateway.proto:822
encryption_algorithm was removed from namespace_cli, leaving field number 25 unused but not reserved. To prevent accidental reuse (which would break wire compatibility for older clients that may still decode/ignore field 25), reserve the field number and name inside namespace_cli, then regenerate the generated stubs. optional string rbd_data_pool_name = 22;
optional string location = 23;
optional string rados_namespace_name = 24;
repeated encryption_entry encryption_entries = 26;
optional bool degraded = 27;
tests/test_rbd_encrypt.py:1182
The portB
namespace list --format json output is no longer checked for absence of encryption_algorithm. Add the same negative assertion as for portA so the test verifies the behavior on both gateways.This issue also appears on line 1257 of the same file.
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
cli(["namespace", "del", "--subsystem", subsystem1, "--nsid", "1"])
</details>
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
<details>
<summary>Files not reviewed (1)</summary>
lib/go/nvmeof/gateway.pb.go: Generated file
</details>
<details>
<summary>Suppressed comments (3)</summary>
tests/test_rbd_encrypt.py:1262
This test asserts that encryption_algorithm is absent for the first namespace list call (server A), but it does not assert the same for the second call (server B) before clearing the log. Add a not in assertion for the server B output to fully validate the behavior.
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
caplog.clear()
tests/test_rbd_encrypt.py:1183
This test verifies that server A's
namespace list --format json output omits encryption_algorithm, but it doesn't make the same assertion for the server B call after caplog.clear(). Add the absence assertion for the second listing so the test actually enforces the behavior across both gateways.This issue also appears on line 1257 of the same file.
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
cli(["namespace", "del", "--subsystem", subsystem1, "--nsid", "1"])
control/proto/gateway.proto:797
The field number 25 is correctly reserved, but the removed field name should also be reserved to prevent accidental reuse in a future proto revision (which would break wire compatibility with older clients/servers that still know about
encryption_algorithm). reserved 25;
</details>
Approved these changes.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
<details>
<summary>Files not reviewed (1)</summary>
lib/go/nvmeof/gateway.pb.go: Generated file
</details>
<details>
<summary>Suppressed comments (2)</summary>
tests/test_rbd_encrypt.py:1261
This test checks that gateway A omits encryption_algorithm in JSON output, but it doesn't assert the same for the gateway B namespace list call. Add the same negative assertion for the second gateway to fully validate the behavior across both endpoints.
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
tests/test_rbd_encrypt.py:1182
encryption_algorithm field, but it no longer checks the same for gateway B. Since this test explicitly queries both gateways, it should also assert the field is absent in the second namespace list output to prevent partial regressions.This issue also appears on line 1259 of the same file.
cli(["--format", "json", "--server-port", portB, "namespace", "list",
"--subsystem", subsystem1, "--nsid", "1"])
assert '"nsid": 1' in caplog.text
assert '"format": "luks1"' in caplog.text
assert f'"key_id": "{key_id}"' in caplog.text
</details>
caroav
gbregman
Fixes: #2077