-
Notifications
You must be signed in to change notification settings - Fork 34
Keystone: Group Controller #597
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
Conversation
winiciusallan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, it is very close to a merge state. Really well done, Daniel. Thanks!
internal/controllers/group/status.go
Outdated
| // TODO(scaffolding): add all of the fields supported in the GroupResourceStatus struct | ||
| // If a zero-value isn't expected in the response, place it behind a conditional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you have forgot? If you're still working, ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that one, Thanks @winiciusallan 👍
| ref: group | ||
| assertAll: | ||
| - celExpr: "group.status.id != ''" | ||
| - celExpr: "!has(group.status.resource.description)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, KUTTL does not catch if a property is not present just matching with the declared status, right? Is that why you added this expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- celExpr: "!has(group.status.resource.description)" will explicitly check that the description field does not exist in the actual resource, since leaving it out of the expected state alone is not enough. So yes because KUTTL doesn't catch if a field is missing, is exactly the reason this CEL assertion is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Thanks for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this is a common pattern we're already using in our tests.
| kind: Group | ||
| metadata: | ||
| name: group-dependency-no-domain | ||
| status: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of checking this after dependency creation?
assertAll:
- celExpr: "group.status.resource.domainID == domain.status.id"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍 will add it in to verify that the Group resource picks up the real domain.status.id
b26e0d1 to
740e9cf
Compare
|
Failed to assess the semver bump. See logs for details. |
740e9cf to
1fa78a7
Compare
|
Failed to assess the semver bump. See logs for details. |
CLI Command: go run ./cmd/scaffold-controller -interactive=false \ -kind Group \ -gophercloud-client NewIdentityV3 \ -gophercloud-module github.com/gophercloud/gophercloud/v2/openstack/identity/v3/groups \ -import-dependency Domain \ -optional-create-dependency Domain Signed-off-by: Daniel Lawton <dlawton@redhat.com>
1fa78a7 to
b11149c
Compare
| @@ -1,28 +1,23 @@ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, was this empty line generated by the scaffolding tool? If so we'll want to fix the template because this will generate an obscure warning when running the kuttl tests. See #580.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it out and yep! the scaffold is the culprit, will look more into why at a later time 👍
| ref: group | ||
| assertAll: | ||
| - celExpr: "group.status.id != ''" | ||
| - celExpr: "!has(group.status.resource.description)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this is a common pattern we're already using in our tests.
| kind: Domain | ||
| name: group-dependency | ||
| ref: domain | ||
| - apiVersion: v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit: we do not need to get the secret anymore in this step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed 👍
| @@ -0,0 +1,8 @@ | |||
| --- | |||
| apiVersion: openstack.k-orc.cloud/v1alpha1 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered disabling this domain at the same time as the other one? This would make the operation run in parallel rather than sequentially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, changes made 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the import-dependency test removed? Was it not relevant? If so you should explain in the commit message why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it back in there 👍
b11149c to
bb24e02
Compare
- E2E tests included (except group-import-dependency) - API configured - Controller
bb24e02 to
03e01e8
Compare
Add a controller for managing roles.
Closes issue: #582