Skip to content

Commit

Permalink
spec: Drop version field from ContainerInfo scheme
Browse files Browse the repository at this point in the history
The field is unused, cannot be set on creation and can be misleading
about container versioning.

From now getting and listing ops respond w/o this field.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Mar 22, 2024
1 parent 30d5f3b commit 1d8deab
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 121 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This document outlines major changes between releases.

## [Unreleased]

### Removed
- `version` field of container info (#xxx)

## [0.8.2] - 2024-03-21

### Fixed
Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-rest-gw/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,6 @@ func restContainerGet(ctx context.Context, t *testing.T, owner user.ID, cnrID ci
require.Equal(t, cnrID.EncodeToString(), cnrInfo.ContainerId)
require.Equal(t, owner.EncodeToString(), cnrInfo.OwnerId)
require.Equal(t, containerName, cnrInfo.ContainerName)
require.NotEmpty(t, cnrInfo.Version)
}

func restContainerDelete(ctx context.Context, t *testing.T, clientPool *pool.Pool, owner user.ID, signer user.Signer) {
Expand Down
196 changes: 97 additions & 99 deletions handlers/apiserver/rest-server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions handlers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/nspcc-dev/neofs-sdk-go/pool"
"github.com/nspcc-dev/neofs-sdk-go/session"
"github.com/nspcc-dev/neofs-sdk-go/user"
"github.com/nspcc-dev/neofs-sdk-go/version"
"github.com/nspcc-dev/neofs-sdk-go/waiter"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -310,7 +309,6 @@ func getContainerInfo(ctx context.Context, p *pool.Pool, cnrID cid.ID) (*apiserv
CannedAcl: util.NewString(friendlyBasicACL(cnr.BasicACL())),
PlacementPolicy: sb.String(),
Attributes: attrs,
Version: getContainerVersion(cnr).String(),
}, nil
}

Expand All @@ -337,19 +335,6 @@ func friendlyBasicACL(basicACL acl.Basic) string {
}
}

func getContainerVersion(cnr container.Container) version.Version {
var v2cnr containerv2.Container
cnr.WriteToV2(&v2cnr)

var cnrVersion version.Version
v2version := v2cnr.GetVersion()
if v2version != nil {
cnrVersion = version.Version(*v2version)
}

return cnrVersion
}

func parseContainerID(containerID string) (cid.ID, error) {
var cnrID cid.ID
if err := cnrID.DecodeString(containerID); err != nil {
Expand Down
6 changes: 0 additions & 6 deletions spec/rest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1208,15 +1208,12 @@ components:
- containerName
- ownerId
- placementPolicy
- version
type: object
properties:
containerId:
type: string
containerName:
type: string
version:
type: string
ownerId:
type: string
basicAcl:
Expand All @@ -1234,7 +1231,6 @@ components:
example:
containerId: 5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv
containerName: container
version: "2.11"
ownerId: NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM
basicAcl: 0x1fbf9fff
placementPolicy: REP 2
Expand All @@ -1261,7 +1257,6 @@ components:
containers:
- containerId: 5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv
containerName: container
version: "2.11"
ownerId: NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM
basicAcl: 0x1fbf9fff
placementPolicy: REP 2
Expand All @@ -1272,7 +1267,6 @@ components:
value: container
- containerId: FsE7HLQBBYc2WFJzuTXMcpspDEmwUxsD5YmNb2r25uUu
containerName: container2
version: "2.11"
ownerId: NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM
basicAcl: 0x1fbf9fff
placementPolicy: REP 1
Expand Down

0 comments on commit 1d8deab

Please sign in to comment.