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

fix(cloudformation): Skip SAM Global Tags propagation #4383

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

tronxd
Copy link
Contributor

@tronxd tronxd commented Jan 31, 2023

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

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

Include a description of what makes it a violation and any relevant external links.

Fix

do not try to convert a list into int

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@PelegLi PelegLi left a comment

Choose a reason for hiding this comment

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

The PR title is also a good life advice

@PelegLi PelegLi changed the title fix(cloudformation) Do not try to convert a list into int fix(cloudformation): Do not try to convert a list into int Jan 31, 2023
@@ -66,9 +66,7 @@ def update_attribute(
key_to_update = ".".join(attribute_key_parts[i:])
break

if isinstance(obj_to_update, list):
key_to_update = int(key_to_update)
Copy link
Contributor

Choose a reason for hiding this comment

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

if remember correctly this was needed for some specific use cases that's why the UTs are failing. Even I don't like, maybe we can add a try/except block. Do you have the problematic template file?

@gruebel gruebel changed the title fix(cloudformation): Do not try to convert a list into int fix(cloudformation): Skip SAM Global Tags propagation Jan 31, 2023
@gruebel gruebel merged commit f72cb53 into main Jan 31, 2023
@gruebel gruebel deleted the cfn_block_attribute_updates branch January 31, 2023 17:37
ToNYmSss pushed a commit to ToNYmSss/checkov that referenced this pull request Jan 31, 2023
)

* do not try to convert a list into int

* exlude SAM Global Tags

---------

Co-authored-by: gruebel <anton.gruebel@gmail.com>
andyloughran pushed a commit to andyloughran/checkov that referenced this pull request Feb 10, 2023
)

* do not try to convert a list into int

* exlude SAM Global Tags

---------

Co-authored-by: gruebel <anton.gruebel@gmail.com>
andyloughran pushed a commit to andyloughran/checkov that referenced this pull request Feb 10, 2023
)

* do not try to convert a list into int

* exlude SAM Global Tags

---------

Co-authored-by: gruebel <anton.gruebel@gmail.com>
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.

None yet

4 participants