forked from TrueCloudLab/frostfs-node
[#249] node: Drop subnet from IR and morph
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d757d881d0
commit
f07d4158f5
41 changed files with 55 additions and 1935 deletions
|
@ -5,13 +5,11 @@ import (
|
|||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
cntClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/container"
|
||||
morphsubnet "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/subnet"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
||||
containerEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/container"
|
||||
containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
|
||||
subnetid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/subnet/id"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -77,12 +75,6 @@ func (cp *Processor) checkPutContainer(ctx *putContainerContext) error {
|
|||
return fmt.Errorf("auth container creation: %w", err)
|
||||
}
|
||||
|
||||
// check owner allowance in the subnetwork
|
||||
err = checkSubnet(cp.subnetClient, cnr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("incorrect subnetwork: %w", err)
|
||||
}
|
||||
|
||||
// check homomorphic hashing setting
|
||||
err = checkHomomorphicHashing(cp.netState, cnr)
|
||||
if err != nil {
|
||||
|
@ -222,29 +214,6 @@ func checkNNS(ctx *putContainerContext, cnr containerSDK.Container) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func checkSubnet(subCli *morphsubnet.Client, cnr containerSDK.Container) error {
|
||||
prm := morphsubnet.UserAllowedPrm{}
|
||||
|
||||
subID := cnr.PlacementPolicy().Subnet()
|
||||
if subnetid.IsZero(subID) {
|
||||
return nil
|
||||
}
|
||||
|
||||
prm.SetID(subID.Marshal())
|
||||
prm.SetClient(cnr.Owner().WalletBytes())
|
||||
|
||||
res, err := subCli.UserAllowed(prm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not check user in contract: %w", err)
|
||||
}
|
||||
|
||||
if !res.Allowed() {
|
||||
return fmt.Errorf("user is not allowed to create containers in %v subnetwork", subID)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkHomomorphicHashing(ns NetworkState, cnr containerSDK.Container) error {
|
||||
netSetting, err := ns.HomomorphicHashDisabled()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue