Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sundowndev-snyk
Copy link
Contributor

@sundowndev-snyk sundowndev-snyk commented Jul 11, 2022

Q A
πŸ› Bug fix? yes
πŸš€ New feature? no
⚠ Deprecations? no
❌ BC Break no
πŸ”— Related issues CTX-336
❓ Documentation no

Description

The current feature that discovers state from HCL files does not support non-default workspaces. This PR intend to fix that.

fix: tfstate discovering

  • Added remain HCL fields to schemas in order to allow other fields
  • Fixed discovering for s3 and gcs backends according to the current workspace

refactor: backend to supplier config

  • Parse workspace name first then pass it to the backend to generate the supplier config

@sundowndev-snyk sundowndev-snyk added the kind/bug Something isn't working label Jul 11, 2022
@sundowndev-snyk sundowndev-snyk requested a review from moadibfr July 11, 2022 12:58
@sundowndev-snyk sundowndev-snyk force-pushed the fix/tf-hcl-schema branch 2 times, most recently from bb48e76 to 316de88 Compare July 11, 2022 13:40
@codecov-commenter
Copy link

Codecov Report

Merging #1562 (ec5190f) into main (516609f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1562      +/-   ##
==========================================
+ Coverage   81.41%   81.43%   +0.01%     
==========================================
  Files         442      442              
  Lines       16215    16229      +14     
==========================================
+ Hits        13202    13216      +14     
  Misses       2687     2687              
  Partials      326      326              
Impacted Files Coverage Ξ”
pkg/terraform/hcl/backend.go 74.50% <100.00%> (+2.16%) ⬆️
pkg/terraform/hcl/hcl.go 86.95% <100.00%> (+10.03%) ⬆️

Parse workspace name first then pass it to the SupplierConfig function, so we don't it once and do not have to store it anywhere. Also add a test case for unknown backend.
Copy link
Contributor

@eliecharra eliecharra left a comment

Choose a reason for hiding this comment

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

I miss some context so I asked a few questions.

And a testcase seems useless to me

@eliecharra eliecharra requested review from eliecharra and removed request for moadibfr July 12, 2022 08:40
@eliecharra eliecharra self-assigned this Jul 12, 2022
@sundowndev-snyk sundowndev-snyk merged commit 7e5c31f into main Jul 12, 2022
@sundowndev-snyk sundowndev-snyk deleted the fix/tf-hcl-schema branch July 12, 2022 12:36
@sundowndev-snyk sundowndev-snyk changed the title Support tfstate discovering within workspaces Support tfstate discovery within workspaces Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants