Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report quota per storage space #2152

Merged
merged 16 commits into from
Oct 14, 2021
Merged

Report quota per storage space #2152

merged 16 commits into from
Oct 14, 2021

Conversation

micbar
Copy link
Member

@micbar micbar commented Oct 11, 2021

Description

Implementation of cs3org/cs3apis#147

Make the cs3apis accept a Reference in the getQuota Request to limit the call to a specific storage space.

Scope

  • This implements the change only in the decomposed fs

@ishank011 @labkode that should not affect cernbox.

Example

      req := &gateway.GetQuotaRequest{
		Ref: &provider.Reference{
			ResourceId: &provider.ResourceId{
				StorageId: space.Root.StorageId,
				OpaqueId:  space.Root.OpaqueId,
			},
			Path: ".",
		},
	}
	res, err := client.GetQuota(ctx, req)

@update-docs
Copy link

update-docs bot commented Oct 11, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

pkg/storage/utils/decomposedfs/node/node.go Outdated Show resolved Hide resolved
pkg/storage/utils/decomposedfs/upload.go Outdated Show resolved Hide resolved
pkg/storage/utils/decomposedfs/upload.go Outdated Show resolved Hide resolved
@micbar
Copy link
Member Author

micbar commented Oct 11, 2021

account creation is broken.

@micbar micbar force-pushed the report-quota branch 2 times, most recently from 8c4ce3c to 0e9166f Compare October 12, 2021 09:37
aduffeck and others added 5 commits October 13, 2021 13:51
The next step for the shares storahge provider is to introduce field
masks so the shares can update state and mount point. This PR is based
on the full changeset, but removes everything but the API change.

Add a sharesstorageprovider

The provider exposes all received shares. It can be mounted to /home/Shares
to make a lot of special cases for shares handling in the gateway and
storage drivers superfluous.

Add missing mock file

Implement methods for setting/unsetting arbitrary metadata

Fix tests

Adapt to changes from rebase

Fix creating references with embedded mounts

Fix corner cases when stating shares

Allow moves between shares on the same storage

Make the storage rules known to the gateway as well

Do not choke on non-existent shares

Reject a share when it is being deleted

Fix rebase artifacts

WIP: Refactor statting shares. Merge shares permissions.

update after rebase, fix tests

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

list all shares

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

work on api change

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Fix build

Persist mountpoints in the share managers followin the new cs3 api

Add support for renaming shares in the SharesStorageprovider

Adapt commands for updating received shares

Regenerate the share manager mock

Fix linter warning

Do not raise an internal error when trying to access non-existent shares

Make hound happy

Fix wrong column name in query

Fix typo

Do not confuse user and group names

Add test for listing received group shares

Do not list parent group shares if there is a child share for it already

Make hound happy

Hide the fact that accepted groups shares can be child shares in the db

list shares using the shares manager + hide group shares when the same resource has a user and group share

refactor all the ocs error writing from the new code

Only collide with mountpoints of shares pointing do different resources

Also return shares being shared with one of the user's groups

Add sharesstorageprovider service file for local acceptance tests

Adapt nextcloud share manager to new method signature

Also remove the test for UpdateReceivedShare which can not be tested
anymore with the new signature. The ReceivedShare never held the display
name that's being tested so the test only passed on the data from the
update field, but since the method only takes the actual received share
now this is no longer possible.

WIP: use go-cs3apis fork until it has been merged

Add placeholder changelog to make CI run

Tweak documentation on how to run the acceptance tests

Add missing storage registry rule for the sharesstorageprovider

Fix revad config for local acceptance tests

reduce changes to share api change

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

JSON encode the FieldMask parameter as-is

paramsObj.Ref -> paramsObj.ReceivedShare

Restore deleted test

update code comment

remove go mod replace

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
butonic and others added 4 commits October 14, 2021 10:01
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
butonic
butonic previously approved these changes Oct 14, 2021
@micbar micbar requested a review from butonic October 14, 2021 14:59
pkg/storage/storage.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ishank011 ishank011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I approved by mistake

@micbar micbar requested a review from ishank011 October 14, 2021 16:18
@micbar
Copy link
Member Author

micbar commented Oct 14, 2021

@ishank011 I applied the proposed changes.

@ishank011 ishank011 merged commit 5866f5e into cs3org:master Oct 14, 2021
@butonic butonic deleted the report-quota branch October 15, 2021 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants