-
Notifications
You must be signed in to change notification settings - Fork 179
Add Region() to ResourceMetadata struct and AWSResourceIdentifiers interface
#79
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
Region() to ResourceMetadata struct and AWSResourceIdentifiersRegion() to ResourceMetadata struct and AWSResourceIdentifiers interface
aae8cf1 to
651443d
Compare
jaypipes
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.
@a-hilaly thank you! a few minor comments about naming/wording, nothing major :)
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 adds a new field to `ResourceMetadata` struct and `AWSResourceIdentifiers` interface store the AWSRegion in which the resource is created/should be managed. This patch also updates the `reconciler.getRegion` method to lookup for a region in the status.ResourceMetadata before trying to get one from the resource/namespace annotations or the controller configuration. Addresses aws-controllers-k8s/community#1220 This patch will also require some changes to the code-generator.
651443d to
c15a3a8
Compare
jaypipes
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.
👍 thanks Amine!
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson 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 |
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.
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 adds a new field to
ResourceMetadatastruct andAWSResourceIdentifiersinterface to store the AWS region in whichthe resource is created/should be managed. This patch also updates the
reconciler.getRegionmethod to lookup for a region in thestatus.ResourceMetadata before trying to get one from the
resource/namespace annotations or the controller configuration.
Addresses aws-controllers-k8s/community#1220
This patch will also require some changes to the code-generator.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.