Skip to content

Backport and fix of space membership expired event - #766

Merged
rhafer merged 5 commits into
mainfrom
backport/space_membership_expired_event
Aug 25, 2026
Merged

Backport and fix of space membership expired event#766
rhafer merged 5 commits into
mainfrom
backport/space_membership_expired_event

Conversation

@maki5

@maki5 maki5 commented Aug 12, 2026

Copy link
Copy Markdown

this change is needed for
opencloud-eu/opencloud#3257

@maki5 maki5 changed the title Backport/space membership expired event Backport and fix of space membership expired event Aug 12, 2026
@micbar

micbar commented Aug 14, 2026

Copy link
Copy Markdown
Member

@maki5 good catch. Our implementation is different than ocis.

@butonic Can you review please?

@rhafer rhafer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for looking into this. This changes to the share manager look mostly fine to me, just change it to use the helper for formatting the SpaceId.

I don't think we need to changes for the storage provider (see my comments).

Comment thread pkg/share/manager/jsoncs3/jsoncs3.go Outdated
if s.ResourceId.SpaceId == s.ResourceId.OpaqueId {
if err := events.Publish(ctx, m.eventStream, events.SpaceMembershipExpired{
SpaceOwner: s.GetOwner(),
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},
SpaceID: &provider.StorageSpaceId{OpaqueId: storagespace.FormatStorageID(s.ResourceId.StorageId, s.ResourceId.SpaceId)},

Comment thread pkg/share/manager/jsoncs3/jsoncs3.go Outdated
if s.ResourceId.SpaceId == s.ResourceId.OpaqueId {
if err := events.Publish(ctx, m.eventStream, events.SpaceMembershipExpired{
SpaceOwner: s.GetOwner(),
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here: use FormatStorageID

Comment thread pkg/share/manager/jsoncs3/jsoncs3.go Outdated
if s.ResourceId.SpaceId == s.ResourceId.OpaqueId {
if err := events.Publish(ctx, m.eventStream, events.SpaceMembershipExpired{
SpaceOwner: s.GetOwner(),
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here: use FormatStorageID

Comment thread pkg/share/manager/jsoncs3/jsoncs3.go Outdated
if s.ResourceId.SpaceId == s.ResourceId.OpaqueId {
if err := events.Publish(ctx, m.eventStream, events.SpaceMembershipExpired{
SpaceOwner: s.GetOwner(),
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here: use FormatStorageID

Comment thread pkg/share/manager/jsoncs3/jsoncs3.go Outdated
if s.ResourceId.SpaceId == s.ResourceId.OpaqueId {
if err := events.Publish(ctx, m.eventStream, events.SpaceMembershipExpired{
SpaceOwner: s.GetOwner(),
SpaceID: &provider.StorageSpaceId{OpaqueId: s.ResourceId.StorageId + "$" + s.ResourceId.SpaceId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here: use FormatStorageID

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we really need these changes, they should go into pkg/storage/pkg/decomposedfs/spaces.go. The implementation in pkg/storage/utils is there mostly for historic reference to the "old" ocis driver.

(This is causing confusion very often, probably we should finally remove it 🤔 )

But do we really need those changes here at all? We're already sending the event in the share manager, sending it here again mean we'd emit the event twice per expired space membership.

It would be nice though to have an event listener that consumes the SpaceMembershipExpired Events and removes the associated grants from the storage provider.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

agree, basically I was not able to reproduce this method to be fired on my local tests, seems like this backport is dead code right now and removing it makes sense

@rhafer
rhafer merged commit 81b7f9e into main Aug 25, 2026
18 of 19 checks passed
@rhafer
rhafer deleted the backport/space_membership_expired_event branch August 25, 2026 14:10
@openclouders openclouders mentioned this pull request Aug 25, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants