forked from TrueCloudLab/frostfs-node
[#1167] adm/morph: Move literal to const
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
d4f425f86a
commit
41e670c9ba
1 changed files with 5 additions and 3 deletions
|
@ -137,6 +137,8 @@ func SetConfigCmd(cmd *cobra.Command, args []string) error {
|
||||||
return wCtx.AwaitTx()
|
return wCtx.AwaitTx()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const maxECSum = 256
|
||||||
|
|
||||||
func validateConfig(args map[string]any, forceFlag bool) error {
|
func validateConfig(args map[string]any, forceFlag bool) error {
|
||||||
var sumEC int64
|
var sumEC int64
|
||||||
_, okData := args[netmap.MaxECDataCountConfig]
|
_, okData := args[netmap.MaxECDataCountConfig]
|
||||||
|
@ -172,9 +174,9 @@ func validateConfig(args map[string]any, forceFlag bool) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if sumEC > 256 && !forceFlag {
|
if sumEC > maxECSum && !forceFlag {
|
||||||
return fmt.Errorf("the sum of %s and %s must be <= 256, got %d",
|
return fmt.Errorf("the sum of %s and %s must be <= %d, got %d",
|
||||||
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, sumEC)
|
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, maxECSum, sumEC)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue