-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add Rule
resource
#7
Conversation
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.
Really great work on this @embano1! You're definitely getting the hang of ACK development! :)
A few relatively minor suggestions inline but nothing big.
Best,
-jay
YOU BET! Thx for your great detailed reviews! Next resources already waiting for your 🦅 👁️ :D |
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.
Mostly comments regarding initialism casing and code layout. I have no qualms with the logic itself though, it's great!
@RedbackThomson addressed all comments in a squashed commit. |
Thx @jaypipes. Will wait for your PR to merge then rebase and regenerate. |
The initialisms PR is already merged, and the code-generator updated with that commit - aws-controllers-k8s/code-generator#400 :) |
566f3b0
to
7ff7a61
Compare
@jaypipes @RedbackThomson Comments addressed and tests are passing PTAL |
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.
Looks ready to ship :)
replacements = REPLACEMENT_VALUES.copy() | ||
replacements["BUS_NAME"] = eb_cr["spec"]["name"] | ||
replacements["RULE_NAME"] = resource_name | ||
replacements["EVENT_PATTERN"] = "{\\\"detail-type\\\":[\\\"ack-event\\\"]}" |
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.
nit: Could make this easier using json.dumps
:
replacements["EVENT_PATTERN"] = "{\\\"detail-type\\\":[\\\"ack-event\\\"]}" | |
replacements["EVENT_PATTERN"] = json.dumps({ | |
"detail-type": ["ack-event"] | |
}) |
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.
Oh god, thank you!
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.
Didn't work since, this is directory going to the resource yaml file..
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.
You'll need to wrap the YAML file variable with double quotes, so that it doesn't try to unwrap it as an object:
eventPattern: "$EVENT_PATTERN"
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 did:
apiVersion: eventbridge.services.k8s.aws/v1alpha1
kind: Rule
metadata:
name: $RULE_NAME
spec:
name: $RULE_NAME
eventBusName: $BUS_NAME
eventPattern: "$EVENT_PATTERN"
tags:
- key: env
value: testing
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.
Let me give a shot and see if it will work with single quote, i can submit a new PR or fix in the next one
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.
Oh yeah I'm seeing this in the EKS controller advanced configuration PR as well. We just need some combination of single quotes and double quotes that don't cause string escape issues 👍🏼
Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, embano1, 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 |
Description of changes: Add
Rule
resource.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.