[#1139] adm: fix dump-config output
All checks were successful
DCO action / DCO (pull_request) Successful in 2m48s
Vulncheck / Vulncheck (pull_request) Successful in 3m3s
Build / Build Components (1.22) (pull_request) Successful in 4m1s
Build / Build Components (1.21) (pull_request) Successful in 4m6s
Tests and linters / Staticcheck (pull_request) Successful in 4m35s
Tests and linters / gopls check (pull_request) Successful in 4m48s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m35s
Tests and linters / Lint (pull_request) Successful in 6m24s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m54s
Tests and linters / Tests with -race (pull_request) Successful in 9m0s
Tests and linters / Tests (1.22) (pull_request) Successful in 9m13s

Added preferable type to params in `frostfs-adm morph dump-config`
output.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
Ekaterina Lebedeva 2024-05-16 20:33:18 +03:00
parent af57d5a6a1
commit c255d3ea12
2 changed files with 10 additions and 1 deletions

View file

@ -61,7 +61,9 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig, case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig, netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig, netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig,
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig: netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig,
netmap.EigenTrustIterationsConfig, netmap.BasicIncomeRateConfig,
netmap.AuditFeeConfig:
nbuf := make([]byte, 8) nbuf := make([]byte, 8)
copy(nbuf[:], v) copy(nbuf[:], v)
n := binary.LittleEndian.Uint64(nbuf) n := binary.LittleEndian.Uint64(nbuf)
@ -71,6 +73,9 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
return helper.InvalidConfigValueErr(k) return helper.InvalidConfigValueErr(k)
} }
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%t (bool)\n", k, v[0] == 1))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%t (bool)\n", k, v[0] == 1)))
case netmap.EigenTrustAlphaConfig:
res, _ := hex.DecodeString(hex.EncodeToString(v))
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (string)\n", k, res)))
default: default:
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (hex)\n", k, hex.EncodeToString(v)))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (hex)\n", k, hex.EncodeToString(v))))
} }

View file

@ -20,6 +20,10 @@ const (
WithdrawFeeConfig = "WithdrawFee" WithdrawFeeConfig = "WithdrawFee"
HomomorphicHashingDisabledKey = "HomomorphicHashingDisabled" HomomorphicHashingDisabledKey = "HomomorphicHashingDisabled"
MaintenanceModeAllowedConfig = "MaintenanceModeAllowed" MaintenanceModeAllowedConfig = "MaintenanceModeAllowed"
EigenTrustIterationsConfig = "EigenTrustIterations"
EigenTrustAlphaConfig = "EigenTrustAlpha"
BasicIncomeRateConfig = "BasicIncomeRate"
AuditFeeConfig = "AuditFee"
) )
// MaxObjectSize receives max object size configuration // MaxObjectSize receives max object size configuration