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

Manila: add List for share-access-rules API #2512

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

gman0
Copy link
Contributor

@gman0 gman0 commented Nov 22, 2022

@coveralls
Copy link

coveralls commented Nov 22, 2022

Coverage Status

Coverage: 80.087% (-0.04%) from 80.131% when pulling 3d1e981 on gman0:shareaccessrules-list into c4fd26e on gophercloud:master.

Copy link
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

PR looks good apart from the failing test.

t.Fatalf("Unable to grant access to share %s: %v", share.ID, err)
}

accessRules, err := ShareAccessRuleList(t, client, shareAccessRight.ID)
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 you pass share.ID instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes, copy-paste mishap. Thanks!

@gman0
Copy link
Contributor Author

gman0 commented Nov 23, 2022

I think the acceptance test needs to wait until the access rule is ready.

@mandre
Copy link
Contributor

mandre commented Nov 24, 2022

I think the acceptance test needs to wait until the access rule is ready.

You can make use of the WaitFor() helper function. See for example how the compute acceptance tests use it.

@gman0 gman0 force-pushed the shareaccessrules-list branch 5 times, most recently from e07c5e6 to db07949 Compare February 14, 2023 16:40
Comment on lines +23 to +35
// AccessRightToShareAccess is a helper function that converts
// shares.AccessRight into shareaccessrules.ShareAccess struct.
func AccessRightToShareAccess(accessRight *shares.AccessRight) *shareaccessrules.ShareAccess {
return &shareaccessrules.ShareAccess{
ShareID: accessRight.ShareID,
AccessType: accessRight.AccessType,
AccessTo: accessRight.AccessTo,
AccessKey: accessRight.AccessKey,
AccessLevel: accessRight.AccessLevel,
State: accessRight.State,
ID: accessRight.ID,
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit confusing -- we have shares.AccessRight and shareaccessrules.ShareAccess. shareaccessrules describes a new API, so technically it ought to be its own package and struct, but in the end it describes the same information as shares.AccessRight does. I'm just pointing this out, but if reviewers are ok with this split, we can move on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine by me. We can always split that into a separate package later if that bothers us.

@gman0
Copy link
Contributor Author

gman0 commented Feb 15, 2023

https://github.com/gophercloud/gophercloud/actions/runs/4182887756/jobs/7246548686 failed on OpenStack install:

--2023-02-15 10:46:04--  http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img
Resolving download.cirros-cloud.net (download.cirros-cloud.net)... 64.90.42.85, 2607:f298:6:a036::bd6:a72a
Connecting to download.cirros-cloud.net (download.cirros-cloud.net)|64.90.42.85|:80... connected.
HTTP request sent, awaiting response... 429 Too Many Requests
2023-02-15 10:46:04 ERROR 429: Too Many Requests.

PTAL @mandre

Copy link
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Comment on lines +23 to +35
// AccessRightToShareAccess is a helper function that converts
// shares.AccessRight into shareaccessrules.ShareAccess struct.
func AccessRightToShareAccess(accessRight *shares.AccessRight) *shareaccessrules.ShareAccess {
return &shareaccessrules.ShareAccess{
ShareID: accessRight.ShareID,
AccessType: accessRight.AccessType,
AccessTo: accessRight.AccessTo,
AccessKey: accessRight.AccessKey,
AccessLevel: accessRight.AccessLevel,
State: accessRight.State,
ID: accessRight.ID,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine by me. We can always split that into a separate package later if that bothers us.

@mandre mandre added this to the v1.3.0 milestone Feb 23, 2023
@mandre mandre merged commit caf087d into gophercloud:master Feb 23, 2023
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.

None yet

3 participants