Add CRUD support for register limit APIs#2616
Conversation
There was a problem hiding this comment.
Thank you for submitting your first PR! Be sure that we will be looking at it but keep in mind
this sometimes takes a while.
Please let the maintainers know if your PR has not got enough attention after a few days.
If any doubt, please consult our PR tutorial.
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
4b90541 to
59f52e1
Compare
bdaf4d5 to
9412d59
Compare
|
@konan-abhi is this ready for review? Otherwise, I suggest you mark your PR as draft while you're still working on it. |
Hi @mandre I am struggling to fix unit tests (since not able to run/debug them locally). Any inputs there will be helpful. Other than that I think functional and other tests are working as expected and yes apart from unittests failure the patch is ready for review. |
mandre
left a comment
There was a problem hiding this comment.
Hi @mandre I am struggling to fix unit tests (since not able to run/debug them locally). Any inputs there will be helpful. Other than that I think functional and other tests are working as expected and yes apart from unittests failure the patch is ready for review.
Contrary to acceptance tests, you don't need a live environment to run the unit tests. You can run them locally with:
go test -v ./openstack/identity/v3/registered_limits/testing
That should make it easier to fix the unit tests.
I've pointed to the errors that are currently reported, but there a few more.
|
This should close #2290, or partially implement. Just linking the PR with the issue |
9412d59 to
5101958
Compare
Thank you, |
5101958 to
6172e89
Compare
|
Does the failure in unit test means missing acceptance test for Get call? |
It complains that the comment doesn't follow go formatting. |
8413e39 to
936dcb9
Compare
E.g. used in keystone service to register limits for particular service. Depends-On: gophercloud/gophercloud/pull/2616
E.g. used in keystone service to register limits for particular service. Depends-On: gophercloud/gophercloud/pull/2616
I also see the unit tests failing: @mandre any particular reason to stay on 1.14 ? |
|
In general the patch passes locally: I suspect we should address something related to the CI (functional-identity tests instead are failing for unrelated issues) |
|
The acceptance tests didn't run because we're missing the |
c1354cb to
cc2f38f
Compare
| defer os.Unsetenv("OS_SYSTEM_SCOPE") | ||
|
|
||
| clients.RequireAdmin(t) | ||
| clients.SkipReleasesBelow(t, "stable/xena") |
There was a problem hiding this comment.
Unless we're using an API endpoint that is only available from Xena there is no reason to add a skip.
| th "github.com/gophercloud/gophercloud/testhelper" | ||
| ) | ||
|
|
||
| func TestRegisteredLimitsList(t *testing.T) { |
There was a problem hiding this comment.
We should probably combine the List test within TestRegisteredLimitsCRUD so that we have openstack return results.
| th.AssertNoErr(t, err) | ||
| } | ||
|
|
||
| func TestCreateRegisteredLimits(t *testing.T) { |
There was a problem hiding this comment.
Same, this could be part of TestRegisteredLimitsCRUD().
| client, err := clients.NewIdentityV3Client() | ||
| th.AssertNoErr(t, err) | ||
|
|
||
| // Find image service (glance on Devstack) |
There was a problem hiding this comment.
We could just pick the first service (doesn't have to be glance) to simplify the test a little.
| th.AssertEquals(t, resourceName, createdRegisteredLimits[0].ResourceName) | ||
| th.AssertEquals(t, serviceID, createdRegisteredLimits[0].ServiceID) | ||
|
|
||
| //Delete the registered limit |
There was a problem hiding this comment.
Nit: as a general formatting rule, try leaving a space before the comment.
| ResourceName string `json:"resource_name" required:"true"` | ||
|
|
||
| // DefaultLimit is the default limit. | ||
| DefaultLimit int `json:"default_limit"` |
There was a problem hiding this comment.
default_limit is also a required parameter according to the doc.
cc2f38f to
23b9b15
Compare
|
Ready for review! |
E.g. used in keystone service to register limits for particular service. Depends-On: gophercloud/gophercloud/pull/2616
|
@mandre Thank you for review, may I know when we can expect the release of 1.4.0? Our new development work depends on this new release. Thank you! |
We don't know yet when we'll release 1.4.0, probably in not too long. In the meantime, you may want to depend on the master branch, or on a fork that you control. |
Thanks @mandre for the input, do you have general timeline that is usually followed as a general rule when bumping from a tag to the next one? |
There's no strict rule, it generally depends on whether there's activity in the open PRs, and how long since the last tag. We try to release every other month. |
|
@konan-abhi @fmount FYI, there's now a v1.4.0 version that includes your change. |
|
Thank you very much!! |
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes a boolean that can be used to enforce per-tenant quotas in the GlanceAPI. If true, the related glance-api section is enabled and templateParameters are populated. This patch assumes the quota resources are already registered in keystone. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes the data structure and implement the related logic that can be used to enforce per-tenant quotas in the GlanceAPI. When limits are defined, the related glance-api config section is enabled and templateParameters are populated. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes the data structure and implement the related logic that can be used to enforce per-tenant quotas in the GlanceAPI. When limits are defined, the related glance-api config section is enabled and templateParameters are populated. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes the data structure and implement the related logic that can be used to enforce per-tenant quotas in the GlanceAPI. When limits are defined, the related glance-api config section is enabled and templateParameters are populated. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes the data structure and implement the related logic that can be used to enforce per-tenant quotas in the GlanceAPI. When limits are defined, the related glance-api config section is enabled and templateParameters are populated. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This patch exposes the data structure and implement the related logic that can be used to enforce per-tenant quotas in the GlanceAPI. When limits are defined, the related glance-api config section is enabled and templateParameters are populated. Depends-On: openstack-k8s-operators/lib-common/pull/262 Depends-On: gophercloud/gophercloud/pull/2616 Depends-On: openstack-k8s-operators/lib-common/pull/284 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
docs
code