forked from TrueCloudLab/frostfs-s3-gw
Compare commits
2 commits
ed4cc417b7
...
dce34ddb9b
Author | SHA1 | Date | |
---|---|---|---|
dce34ddb9b | |||
7c2f247442 |
2 changed files with 8 additions and 7 deletions
|
@ -42,6 +42,7 @@ type PrmContainerCreate struct {
|
||||||
AdditionalAttributes [][2]string
|
AdditionalAttributes [][2]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PrmAddContainerPolicyChain groups parameter of FrostFS.AddContainerPolicyChain operation.
|
||||||
type PrmAddContainerPolicyChain struct {
|
type PrmAddContainerPolicyChain struct {
|
||||||
ContainerID cid.ID
|
ContainerID cid.ID
|
||||||
Chain chain.Chain
|
Chain chain.Chain
|
||||||
|
|
|
@ -137,18 +137,18 @@ func (x *FrostFS) CreateContainer(ctx context.Context, prm frostfs.PrmContainerC
|
||||||
|
|
||||||
// AddContainerPolicyChain implements frostfs.FrostFS interface method.
|
// AddContainerPolicyChain implements frostfs.FrostFS interface method.
|
||||||
func (x *FrostFS) AddContainerPolicyChain(ctx context.Context, prm frostfs.PrmAddContainerPolicyChain) error {
|
func (x *FrostFS) AddContainerPolicyChain(ctx context.Context, prm frostfs.PrmAddContainerPolicyChain) error {
|
||||||
var prmAddAPEChain pool.PrmAddAPEChain
|
|
||||||
prmAddAPEChain.Target = ape.ChainTarget{
|
|
||||||
TargetType: ape.TargetTypeContainer,
|
|
||||||
Name: prm.ContainerID.EncodeToString(),
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := prm.Chain.MarshalBinary()
|
data, err := prm.Chain.MarshalBinary()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
prmAddAPEChain.Chain = ape.Chain{Raw: data}
|
prmAddAPEChain := pool.PrmAddAPEChain{
|
||||||
|
Target: ape.ChainTarget{
|
||||||
|
TargetType: ape.TargetTypeContainer,
|
||||||
|
Name: prm.ContainerID.EncodeToString(),
|
||||||
|
},
|
||||||
|
Chain: ape.Chain{Raw: data},
|
||||||
|
}
|
||||||
|
|
||||||
err = x.pool.AddAPEChain(ctx, prmAddAPEChain)
|
err = x.pool.AddAPEChain(ctx, prmAddAPEChain)
|
||||||
return handleObjectError("add ape chain to container", err)
|
return handleObjectError("add ape chain to container", err)
|
||||||
|
|
Loading…
Reference in a new issue