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

Check for ownership on migrate cancel and status #1099

Merged

Conversation

ggriffiths
Copy link
Contributor

Signed-off-by: Grant Griffiths [email protected]

What this PR does / why we need it:

  • This enables ownership for cancel and status.

Which issue(s) this PR fixes (optional)
Closes #1098

Special notes for your reviewer:

  • This PR introduces a lot of Volume Inspects on behalf of the user, to check for access.
  • Open to suggestions on optimizing this to reduce the stress on the system.

@ggriffiths ggriffiths force-pushed the cloud_migration_ownership branch 2 times, most recently from 2b522f5 to 9c1492e Compare May 2, 2019 00:18
@ggriffiths ggriffiths requested a review from lpabon May 3, 2019 17:28
@ggriffiths ggriffiths force-pushed the cloud_migration_ownership branch 7 times, most recently from 4e5c2d1 to 2b67287 Compare May 15, 2019 07:18
api/server/sdk/volume_migrate.go Outdated Show resolved Hide resolved
api/server/sdk/volume_migrate.go Show resolved Hide resolved
api/server/sdk/volume_migrate.go Outdated Show resolved Hide resolved
@ggriffiths ggriffiths force-pushed the cloud_migration_ownership branch from 2b67287 to b446805 Compare May 15, 2019 20:52
for _, cluster := range resp.Info {
for _, migrateInfo := range cluster.List {
if err := checkAccessFromDriverForVolumeId(ctx, s.driver(ctx),
migrateInfo.GetLocalVolumeId(), api.Ownership_Read); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be api.OwnershipWrite? since the check is being used for cancel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it to that, but anyone with Read Access can start a migration for that volume, so I figured that delete/status should match that.

Let me see what Bhavana and Luis think.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@ggriffiths ggriffiths force-pushed the cloud_migration_ownership branch from b446805 to 0d4fdf9 Compare May 16, 2019 07:48
@ggriffiths
Copy link
Contributor Author

Just re-tested this on two px clusters with the latest changes - works as expected.

@ggriffiths ggriffiths merged commit cddfa8f into libopenstorage:master May 17, 2019
@ggriffiths ggriffiths deleted the cloud_migration_ownership branch May 17, 2019 18:29
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.

Add ownership to migration status and cancel
3 participants