[#482] Fix containers resolving #482
No reviewers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#482
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:bugfix/containers_resolving"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
8ff19bfecb
to01434ed747
[#xxx] Fix containers resolvingto [#482] Fix containers resolving@ -213,3 +214,3 @@
resolveFunc := func(ctx context.Context, name string) (cid.ID, error) {
var d container.Domain
d.SetName(name)
if strings.Contains(name, ".") {
Actually bucket name can consist dot. So we cannot use such logic.
I suggest not to use bucket resolver to resolve containers from config on application startup.
Let's use separate function to resolve such containers
As an alternative, we can change
Resolve(ctx context.Context, name string)
signature by passing zone name explicitly. Both DNS and NNS resolver implementations take zone from context.For S3 operations, pass zone from
reqInfo
. As for settings container resolving, use splitting by '.'01434ed747
to7d59a1b1d3
@ -171,3 +164,3 @@
var dns ns.DNS
resolveFunc := func(ctx context.Context, name string) (cid.ID, error) {
resolveFunc := func(ctx context.Context, name, zone string, isDefault bool) (cid.ID, error) {
I don't like
isDefault bool
param. Maybe we can keepsettings
that has method to find out if provided zone is default?Or just compare zone with
v2container.SysAttributeZoneDefault
inside this function@ -1063,3 +1063,3 @@
var id cid.ID
if err = id.DecodeString(containerString); err != nil {
if id, err = a.bucketResolver.Resolve(ctx, containerString); err != nil {
parts := strings.Split(containerString, ".")
It seems we should check if parts has length 2
7d59a1b1d3
to8bc5ae47d0
@ -329,3 +329,3 @@
}
containerID, err := n.ResolveBucket(ctx, name)
containerID, err := n.ResolveBucket(ctx, name, zone)
Minor (non-blocking): It's a little odd to see:
in one case we use order
zone
,name
, in othername
,zone
. Ideally it should be consistent (especially because they are close to each other)8bc5ae47d0
to6259caccb8
New commits pushed, approval review dismissed automatically according to repository settings
@ -1064,2 +1064,3 @@
if err = id.DecodeString(containerString); err != nil {
if id, err = a.bucketResolver.Resolve(ctx, containerString); err != nil {
parts := strings.Split(containerString, ".")
if len(parts) != 2 {
I am not sure this check is valid. I think it should be possible to define
lifecycle.s3.reserved
container, for example.So we can rewrite it like that
In this case, zone should be
s3.reserved
?I suppose so. The same as namespace zone which is
<namespace-name>.ns
.And probably it doesn't matter for system container, because NNS resolver is going to glue domain name and zone anyway (link).
6259caccb8
tod919e6cce2