diff --git a/api/cache/cache_test.go b/api/cache/cache_test.go index 0db074a18..679b491b4 100644 --- a/api/cache/cache_test.go +++ b/api/cache/cache_test.go @@ -153,7 +153,7 @@ func TestSettingsCacheType(t *testing.T) { cache := NewSystemCache(DefaultSystemConfig(logger)) key := "key" - settings := &data.BucketSettings{Versioning: data.VerEnabled} + settings := &data.BucketSettings{Versioning: data.VersioningEnabled} err := cache.PutSettings(key, settings) require.NoError(t, err) diff --git a/api/data/info.go b/api/data/info.go index 86c5329e7..8cda70603 100644 --- a/api/data/info.go +++ b/api/data/info.go @@ -14,9 +14,9 @@ const ( bktCORSConfigurationObject = ".s3-cors" bktNotificationConfigurationObject = ".s3-notifications" - VerUnversioned = "Unversioned" - VerEnabled = "Enabled" - VerSuspended = "Suspended" + VersioningUnversioned = "Unversioned" + VersioningEnabled = "Enabled" + VersioningSuspended = "Suspended" ) type ( @@ -96,13 +96,13 @@ func (o *ObjectInfo) Address() oid.Address { } func (b BucketSettings) Unversioned() bool { - return b.Versioning == VerUnversioned + return b.Versioning == VersioningUnversioned } func (b BucketSettings) VersioningEnabled() bool { - return b.Versioning == VerEnabled + return b.Versioning == VersioningEnabled } func (b BucketSettings) VersioningSuspended() bool { - return b.Versioning == VerSuspended + return b.Versioning == VersioningSuspended } diff --git a/api/handler/handlers_test.go b/api/handler/handlers_test.go index 9ab09f004..04007bb5f 100644 --- a/api/handler/handlers_test.go +++ b/api/handler/handlers_test.go @@ -109,7 +109,7 @@ func createTestBucketWithLock(ctx context.Context, t *testing.T, h *handlerConte sp := &layer.PutSettingsParams{ BktInfo: bktInfo, Settings: &data.BucketSettings{ - Versioning: data.VerEnabled, + Versioning: data.VersioningEnabled, LockConfiguration: conf, }, } diff --git a/api/handler/put.go b/api/handler/put.go index 94a68e606..ea360a8ab 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -659,7 +659,7 @@ func (h *handler) CreateBucketHandler(w http.ResponseWriter, r *http.Request) { if p.ObjectLockEnabled { sp := &layer.PutSettingsParams{ BktInfo: bktInfo, - Settings: &data.BucketSettings{Versioning: data.VerEnabled}, + Settings: &data.BucketSettings{Versioning: data.VersioningEnabled}, } if err = h.obj.PutBucketSettings(r.Context(), sp); err != nil { h.logAndSendError(w, "couldn't enable bucket versioning", reqInfo, err, diff --git a/api/handler/versioning.go b/api/handler/versioning.go index e04af6f78..f67a784f7 100644 --- a/api/handler/versioning.go +++ b/api/handler/versioning.go @@ -33,7 +33,7 @@ func (h *handler) PutBucketVersioningHandler(w http.ResponseWriter, r *http.Requ return } - if configuration.Status != data.VerEnabled && configuration.Status != data.VerSuspended { + if configuration.Status != data.VersioningEnabled && configuration.Status != data.VersioningSuspended { h.logAndSendError(w, "invalid versioning configuration", reqInfo, err) return } diff --git a/api/layer/locking_test.go b/api/layer/locking_test.go index 3c257d541..bd06d21ec 100644 --- a/api/layer/locking_test.go +++ b/api/layer/locking_test.go @@ -12,7 +12,7 @@ func TestObjectLockAttributes(t *testing.T) { tc := prepareContext(t) err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{ BktInfo: tc.bktInfo, - Settings: &data.BucketSettings{Versioning: data.VerEnabled}, + Settings: &data.BucketSettings{Versioning: data.VersioningEnabled}, }) require.NoError(t, err) diff --git a/api/layer/system_object.go b/api/layer/system_object.go index 367835b73..238c4dd80 100644 --- a/api/layer/system_object.go +++ b/api/layer/system_object.go @@ -189,7 +189,7 @@ func (n *layer) GetBucketSettings(ctx context.Context, bktInfo *data.BucketInfo) if !errorsStd.Is(err, ErrNodeNotFound) { return nil, err } - settings = &data.BucketSettings{Versioning: data.VerUnversioned} + settings = &data.BucketSettings{Versioning: data.VersioningUnversioned} } if err = n.systemCache.PutSettings(systemKey, settings); err != nil { diff --git a/api/layer/versioning_test.go b/api/layer/versioning_test.go index 46cbd7c02..b4bf392c0 100644 --- a/api/layer/versioning_test.go +++ b/api/layer/versioning_test.go @@ -183,7 +183,7 @@ func TestSimpleVersioning(t *testing.T) { tc := prepareContext(t) err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{ BktInfo: tc.bktInfo, - Settings: &data.BucketSettings{Versioning: data.VerEnabled}, + Settings: &data.BucketSettings{Versioning: data.VersioningEnabled}, }) require.NoError(t, err) @@ -220,7 +220,7 @@ func TestSimpleNoVersioning(t *testing.T) { func TestVersioningDeleteObject(t *testing.T) { tc := prepareContext(t) - settings := &data.BucketSettings{Versioning: data.VerEnabled} + settings := &data.BucketSettings{Versioning: data.VersioningEnabled} err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{ BktInfo: tc.bktInfo, Settings: settings, @@ -242,7 +242,7 @@ func TestGetUnversioned(t *testing.T) { objContent := []byte("content obj1 v1") objInfo := tc.putObject(objContent) - settings := &data.BucketSettings{Versioning: data.VerUnversioned} + settings := &data.BucketSettings{Versioning: data.VersioningUnversioned} err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{ BktInfo: tc.bktInfo, Settings: settings, @@ -256,7 +256,7 @@ func TestGetUnversioned(t *testing.T) { func TestVersioningDeleteSpecificObjectVersion(t *testing.T) { tc := prepareContext(t) - settings := &data.BucketSettings{Versioning: data.VerEnabled} + settings := &data.BucketSettings{Versioning: data.VersioningEnabled} err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{ BktInfo: tc.bktInfo, Settings: settings, diff --git a/internal/neofs/tree.go b/internal/neofs/tree.go index ad7cfd2b6..012b6585b 100644 --- a/internal/neofs/tree.go +++ b/internal/neofs/tree.go @@ -266,7 +266,7 @@ func (c *TreeClient) GetSettingsNode(ctx context.Context, cnrID cid.ID) (*data.B return nil, fmt.Errorf("couldn't get node: %w", err) } - settings := &data.BucketSettings{Versioning: data.VerUnversioned} + settings := &data.BucketSettings{Versioning: data.VersioningUnversioned} if versioningValue, ok := node.Get(versioningKV); ok { settings.Versioning = versioningValue }