Skip to content

Conversation

@a-hilaly
Copy link
Member

@a-hilaly a-hilaly commented Mar 21, 2022

Follow up to aws-controllers-k8s/runtime#79

This patch modifies the code-generator to generate a Region function
so that a resource can also satisfy the Identifiers interface. This
the patch also extends the setStatusDefaults so that it correctly
populates the status.ResourceMetadata.Region with the aws region in
which it is created/managed

Description of changes:

  • Add Region() method to resourceIdentifiers template.
  • Modifies setStatusDefaults to be able to set the a default region.
  • Update runtime_test.go

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

@a-hilaly a-hilaly requested review from jaypipes and vijtrip2 March 21, 2022 18:16
@a-hilaly a-hilaly changed the title Add Region() to ResourceMetadata struct and AWSResourceIdentifiers interface Generate Region() method for resourceIdentifiers Mar 21, 2022
Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

Just one nit to bring it in-line with the latest runtime updates

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

👍

@a-hilaly
Copy link
Member Author

/retest

interface

Currently when a resource is created without setting a region in the
annotations, the controller uses either the namespace annotation or the
controller region flag. This causes the controller to miss manage the
resource if they are restart with a different region, or if run a second
controller using a different region flag.

This patch modifies the code-generator to generate a `Region` function
so that a resource can also satisfy the `Identifiers` interface. This
patch also extends the `setStatusDefaults` so that it correctly
populates the status.ResourceMetadata.Region with the aws region in
which it is created/managed

This patch will also require some changes to the runtime repository.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
@vijtrip2
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Mar 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson, vijtrip2

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:
  • OWNERS [A-Hilaly,RedbackThomson,jaypipes,vijtrip2]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot
Copy link
Collaborator

ack-bot commented Mar 22, 2022

@a-hilaly: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
dynamodb-controller-test 9a53ab2 link /test dynamodb-controller-test
s3-controller-test 9a53ab2 link /test s3-controller-test
ecr-controller-test 9a53ab2 link /test ecr-controller-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ack-bot ack-bot merged commit 8baf090 into aws-controllers-k8s:main Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants