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

Prevent exporting terraform to the same output directory #927

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

RemyDeWolf
Copy link
Contributor

@RemyDeWolf RemyDeWolf commented Jul 26, 2022

Description

Each opta layer is associated with one remote backend definition, so we don't want to allow exporting multiple opta layer into the same output directory as this would override the backend when using the --remote option.

With this change, we simplify the generate-terraform usage by expecting a distinct directory output for each layer.
If the output directory is not empty the command would fail to prevent the user to accidently alter their terraform files.

Safety checklist

  • This change is backwards compatible and safe to apply by existing users
  • This change will NOT lead to data loss
  • This change will NOT lead to downtime who already has an env/service setup

How has this change been tested, beside unit tests?

Tested using the getting started example.

@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #927 (5cf7e1d) into main (f1f0644) will decrease coverage by 0.03%.
The diff coverage is 84.21%.

@@            Coverage Diff             @@
##             main     #927      +/-   ##
==========================================
- Coverage   72.83%   72.80%   -0.04%     
==========================================
  Files         120      120              
  Lines        8181     8182       +1     
==========================================
- Hits         5959     5957       -2     
- Misses       2222     2225       +3     
Flag Coverage Δ
unittests 72.80% <84.21%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
opta/commands/generate_terraform.py 96.37% <84.21%> (-1.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1f0644...5cf7e1d. Read the comment docs.

@RemyDeWolf RemyDeWolf merged commit 46a38f9 into main Jul 27, 2022
@RemyDeWolf RemyDeWolf deleted the remy/gen-terraform-multiple-remote branch July 27, 2022 02:56
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.

2 participants