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

Allow factory files to be empty #2719

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Allow factory files to be empty #2719

merged 5 commits into from
Nov 21, 2024

Conversation

LucaPrete
Copy link
Member

Allow net-vpc-firewall factory files to be empty.


Checklist

I applicable, I acknowledge that I have:

  • Read the contributing guide
  • Ran terraform fmt on all modified files
  • Regenerated the relevant README.md files using tools/tfdoc.py
  • Made sure all relevant tests pass

@LucaPrete LucaPrete requested a review from ludoo November 19, 2024 10:54
Copy link
Collaborator

@ludoo ludoo left a comment

Choose a reason for hiding this comment

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

hmmmmmm :)

@ludoo
Copy link
Collaborator

ludoo commented Nov 19, 2024

@wiktorn @juliocc I don't see anything against doing this here, WDYT?

@wiktorn
Copy link
Collaborator

wiktorn commented Nov 19, 2024

@wiktorn @juliocc I don't see anything against doing this here, WDYT?

If I read the code correctly, it solves the problem when egress or ingress is null in YAML, but not when the file is empty?

Gave it a shot with patch:
image

@LucaPrete
Copy link
Member Author

Good point. I can add the coalesce also above.

@LucaPrete
Copy link
Member Author

@wiktorn I added some code which should protect against both cases. Please, let me know if the test now works.

@LucaPrete LucaPrete requested a review from ludoo November 19, 2024 13:17
@wiktorn
Copy link
Collaborator

wiktorn commented Nov 19, 2024

Works for those two cases:

configs/firewall/rules/rule1.yaml:

---

configs/firewall/rules/rule2.yaml:

---

ingress: {}
egress: null

@juliocc
Copy link
Collaborator

juliocc commented Nov 19, 2024

LGTM

@LucaPrete LucaPrete enabled auto-merge (squash) November 19, 2024 14:42
@LucaPrete LucaPrete merged commit 904cf5a into master Nov 21, 2024
18 checks passed
@LucaPrete LucaPrete deleted the vpcFirewallAllowNull branch November 21, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants