Skip to content

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

Merged
mandre merged 1 commit intogophercloud:masterfrom
gman0:shareaccessrules-list
Feb 23, 2023
Merged

Manila: add List for share-access-rules API#2512
mandre merged 1 commit intogophercloud:masterfrom
gman0:shareaccessrules-list

Conversation

@gman0
Copy link
Copy Markdown
Contributor

@gman0 gman0 commented Nov 22, 2022

@coveralls
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 gman0 force-pushed the shareaccessrules-list branch from ab84de7 to 243666f Compare November 23, 2022 14:49
@gman0
Copy link
Copy Markdown
Contributor Author

gman0 commented Nov 23, 2022

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

@mandre
Copy link
Copy Markdown
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 from 243666f to f5f5a59 Compare November 28, 2022 16:10
@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
Copy Markdown
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
Copy Markdown
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 gman0 force-pushed the shareaccessrules-list branch from db07949 to 3d1e981 Compare February 15, 2023 10:24
@gman0
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants