-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Parse TargetGroup names from ARNs #10276
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman 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 |
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 there anything in the integration tests that we could add that would expose this bug and confirm this fix?
tg := &awstasks.TargetGroup{ | ||
Name: fi.String(fmt.Sprintf("external-tg-%d", i)), | ||
Name: fi.String(resource[1]), |
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 assumes that the ARN field after targetgroup/
is always equal to the target group's name and that AWS never modifies that in anyway. is that a safe assumption?
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 think for now should be ok. AWS will break pretty much anything it wants :).
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 now, in case of TGs, the resource ID is always tg-name/big-number
. This PR validates this format so people will know in advance if something is changed in the future.
Technically, tasks are compared by name and ARN. The name is also used for ordering. We could potentially add some logic that detects the external TGs and generates the name is a way that doesn't assume tg-name/big-number
, but would complicate things and add assume some fixed names as belonging to kOps. Seems safer to just assume AWS will not change the ARN format for TGs. For sure AWS will not change the ARNs of existing TGs.
/lgtm |
…-upstream-release-1.19 Automated cherry pick of #10276: Parse TargetGrup names from ARNs
Fixes: #10268
Summary of fixes: