-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add Table
resource custom hooks, terminalCodes and e2e tests
#3
Conversation
// collection that is of type ConditionTypeResourceSynced. If no such condition | ||
// is found, returns nil. | ||
// | ||
// TODO(jaypipes): Move to ACK code-gen templates. |
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.
?? Are these files not auto generated?
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.
Not yet, I guess we still need to experiment with other controllers to figure out a general design
/cc @jaypipes
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.
@RedbackThomson yeah, eventually I'd like to generate functions like these and/or move into ACK runtime. I added these for the mq-controller:
https://github.com/aws-controllers-k8s/mq-controller/blob/main/pkg/resource/broker/conditions.go
https://github.com/aws-controllers-k8s/mq-controller/blob/main/pkg/resource/broker/hooks.go
and then adapted them for the RDS controller:
https://github.com/aws-controllers-k8s/rds-controller/blob/main/pkg/resource/db_instance/conditions.go
https://github.com/aws-controllers-k8s/rds-controller/blob/main/pkg/resource/db_instance/hooks.go
I use the service controllers as a bit of a laboratory for experimentation in this way while I figure out what works as a standard.
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.
3 controllers using same code, good time to move ?
aws-controllers-k8s/community#806
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.
3 controllers using same code, good time to move ?
aws-controllers-k8s/community#806
after I get those logging changes pushed up, yeah...
var ( | ||
requeueWaitWhileDeleting = ackrequeue.NeededAfter( | ||
ErrTableDeleting, | ||
5*time.Second, |
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.
Is this an arbitrary amount? I'd like to see requeue times standardised over all controllers, perhaps?
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.
Not arbitrary, just remarked that tables are created super fast. The default value is 30seconds https://github.com/aws-controllers-k8s/runtime/blob/main/pkg/requeue/requeue.go#L20-L22
if tableDeleting(r) { | ||
return requeueWaitWhileDeleting | ||
} |
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.
Table could be in deleting state before calling delete? I imagine if someone messed with it in the console (outside ACK)?
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.
Yup - not sure if this is something we should consider at this stage.
/ok-to-test |
@a-hilaly: The specified target(s) for
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test dynamodb-kind-e2e |
@a-hilaly: The specified target(s) for
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@RedbackThomson i'm not able to run kind-e2e tests, i can see that we already have generated prow jobs for dynamodb. PTAL |
/test dynamodb-unit-test |
/test dynamodb-kind-e2e |
@a-hilaly: The specified target(s) for
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
if isTableCreating(&resource{ko}) { | ||
return &resource{ko}, requeueWaitWhileCreating | ||
} | ||
if isTableUpdating(&resource{ko}) { | ||
return &resource{ko}, requeueWaitWhileUpdating | ||
} |
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 do we need the above code hooks in the sdkReadOne
post-set-output code paths?
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.
Sometimes tables needs few seconds to get created. re-queuing here is needed to sync the .status.TableStatus
field.
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.
Here what i get when i create a table and wait for few seconds
k get tables
NAME TABLENAME TABLESTATUS
tb1 tb1 CREATING
aws dynamodb describe-table --table-name tb1 | jq
{
...
"TableStatus": "ACTIVE",
...
}
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.
This is fixing a very similar issue to what @phanimullapudi was seeing in mq controller aws-controllers-k8s/community#831
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.
for reviewers: @a-hilaly and I walked through the code and Amine patiently waited for me to understand he was totally correct. :)
/test dynamodb-kind-e2e |
/test dynamodb-kind-e2e |
1 similar comment
/test dynamodb-kind-e2e |
Table
resource custom hooks, terminalCodes, printcolumns and e2e testsTable
resource custom hooks, terminalCodes and e2e tests
/test dynamodb-kind-e2e |
- Add custom hooks and terminalCodes - Regenerate `Table` resource - Add e2e tests for create and delete operations
/test dynamodb-kind-e2e |
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.
👍
if isTableCreating(&resource{ko}) { | ||
return &resource{ko}, requeueWaitWhileCreating | ||
} | ||
if isTableUpdating(&resource{ko}) { | ||
return &resource{ko}, requeueWaitWhileUpdating | ||
} |
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.
for reviewers: @a-hilaly and I walked through the code and Amine patiently waited for me to understand he was totally correct. :)
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Part of aws-controllers-k8s/community#803
Description of changes
Table
resource ingenerator.yaml
Table
create and delete operationsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.