cli: Fix netinfo output for empty unknown parameters #1236

Closed
achuprov wants to merge 1 commit from achuprov/frostfs-node:feat/unknown_network_info_parameters into master
Member

Ref TrueCloudLab/frostfs-sdk-go#232

Before:

$ ./bin/frostfs-cli netmap netinfo  -c /home/achuprov/Documents/work/frostfs-dev-env/wallets/conf.yml

...
FrostFS network configuration (other)
  SystemDNS: 636f6e7461696e6572
  value:

After:

$ ./bin/frostfs-cli netmap netinfo  -c /home/achuprov/Documents/work/frostfs-dev-env/wallets/conf.yml

...
FrostFS network configuration (other)
  SystemDNS: 636f6e7461696e6572
  value: ""

Signed-off-by: Alexander Chuprov a.chuprov@yadro.com

Ref https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/232 Before: ``` $ ./bin/frostfs-cli netmap netinfo -c /home/achuprov/Documents/work/frostfs-dev-env/wallets/conf.yml ... FrostFS network configuration (other) SystemDNS: 636f6e7461696e6572 value: ``` After: ``` $ ./bin/frostfs-cli netmap netinfo -c /home/achuprov/Documents/work/frostfs-dev-env/wallets/conf.yml ... FrostFS network configuration (other) SystemDNS: 636f6e7461696e6572 value: "" ``` Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov force-pushed feat/unknown_network_info_parameters from fabc602021 to afeaf01cea 2024-07-09 09:33:18 +00:00 Compare
achuprov changed title from [#99999] cli: Fix netinfo output for empty unknown parameters to cli: Fix netinfo output for empty unknown parameters 2024-07-09 09:36:06 +00:00
achuprov requested review from storage-core-committers 2024-07-09 09:54:34 +00:00
achuprov requested review from storage-core-developers 2024-07-09 09:54:35 +00:00
acid-ant approved these changes 2024-07-09 10:35:24 +00:00
fyrchik reviewed 2024-07-09 12:52:54 +00:00
@ -52,3 +52,2 @@
cmd.Println("FrostFS network configuration (other)")
netInfo.IterateRawNetworkParameters(func(name string, value []byte) {
cmd.Printf(format, name, hex.EncodeToString(value))
netInfo.IterateRawNetworkParameters(func(name string, rawValue []byte) {
Owner

I personally think the perfect behaviour was fine (we expect hex, we get empty hex)

I personally think the perfect behaviour was fine (we expect hex, we get empty hex)
Author
Member

I think we should display the empty value (just like with namespace). What do you think about nil?

I think we should display the empty value (just like with namespace). What do you think about `nil`?
Owner

The same thing to me.
But if everyone agrees we need this, empty would be less Go-specific.

The same thing to me. But if everyone agrees we need this, `empty` would be less Go-specific.
Author
Member

@aarifullin / @dstepanov-yadro / @elebedeva What do you think?

@aarifullin / @dstepanov-yadro / @elebedeva What do you think?
Member

We should keep in mind that any cli output may be parsed (like test results).

value: ""

and

value: 57277d7b

As we can see these output results are not the same format. Either we need to frame non-nil output to quotes or omit it for the first case. I think if we keep it in current format - that's OK.

We should keep in mind that any cli output *may be* parsed (like test results). ``` value: "" ``` and ``` value: 57277d7b ``` As we can see these output results are not the same format. Either we need to *frame* non-nil output to quotes or omit it for the first case. I think if we keep it in current format - that's OK.
achuprov closed this pull request 2024-07-15 10:12:58 +00:00
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m18s
Required
Details
DCO action / DCO (pull_request) Successful in 3m20s
Required
Details
Build / Build Components (1.21) (pull_request) Successful in 5m0s
Required
Details
Build / Build Components (1.22) (pull_request) Successful in 5m0s
Required
Details
Pre-commit hooks / Pre-commit (pull_request) Successful in 6m19s
Required
Details
Tests and linters / Staticcheck (pull_request) Successful in 6m46s
Required
Details
Tests and linters / gopls check (pull_request) Successful in 6m45s
Required
Details
Tests and linters / Lint (pull_request) Successful in 7m39s
Required
Details
Tests and linters / Tests (1.21) (pull_request) Successful in 9m2s
Required
Details
Tests and linters / Tests (1.22) (pull_request) Successful in 9m3s
Required
Details
Tests and linters / Tests with -race (pull_request) Successful in 10m28s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1236
No description provided.