forked from TrueCloudLab/frostfs-node
[#660] core/container: Use version.IsValid in CheckFormat
Container can have version later than the current lib version, and it should not be considered as invalid. But it should still have adequate version. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8192933313
commit
54d6f3de55
1 changed files with 3 additions and 3 deletions
|
@ -4,9 +4,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/version"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -24,8 +24,8 @@ func CheckFormat(c *container.Container) error {
|
|||
return errNilPolicy
|
||||
}
|
||||
|
||||
if err := pkg.IsSupportedVersion(c.Version()); err != nil {
|
||||
return fmt.Errorf("incorrect version: %w", err)
|
||||
if v := c.Version(); v == nil || !version.IsValid(*v) {
|
||||
return fmt.Errorf("incorrect version %s", v)
|
||||
}
|
||||
|
||||
if ln := len(c.OwnerID().ToV2().GetValue()); ln != owner.NEO3WalletSize {
|
||||
|
|
Loading…
Reference in a new issue