Skip to content
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

core - don't expand {now} placeholder during provisioning #8509

Merged
merged 8 commits into from May 10, 2023

Conversation

ajkerrigan
Copy link
Member

Today we expand the {now} placeholder when a policy executes, regardless of whether we're provisioning a policy or actually running it. This change lets us defer expansion while preserving custom format specifiers.

There may be a more straightforward way to do this...

Closes #8503

@ajkerrigan ajkerrigan requested a review from kapilt as a code owner April 20, 2023 04:47
c7n/policy.py Show resolved Hide resolved
@ajkerrigan ajkerrigan force-pushed the expand-now-at-runtime branch 2 times, most recently from 7a33b8f to e486aa0 Compare April 20, 2023 17:36
tests/test_policy.py Outdated Show resolved Hide resolved
@kapilt
Copy link
Collaborator

kapilt commented May 8, 2023

we should probably have a test here wrt to the current work around re double escape Ala {{now}} as we to validate not breaking extant behavior.

@ajkerrigan
Copy link
Member Author

we should probably have a test here wrt to the current work around re double escape Ala {{now}} as we to validate not breaking extant behavior.

Fair point, added that case.

Copy link
Collaborator

@kapilt kapilt left a comment

Choose a reason for hiding this comment

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

thanks, lgtm

I think there's at least one other issue that gets closed from this as well.

@kapilt kapilt merged commit 4f15613 into cloud-custodian:main May 10, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"{now}" throws an error with c7n 0.9.26
2 participants