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

directory are listed when we use s3 as a backend for states #409

Closed
moadibfr opened this issue Apr 6, 2021 · 3 comments · Fixed by #410 or #429
Closed

directory are listed when we use s3 as a backend for states #409

moadibfr opened this issue Apr 6, 2021 · 3 comments · Fixed by #410 or #429
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@moadibfr
Copy link
Contributor

moadibfr commented Apr 6, 2021

Description
Sometimes directory are listed when we use s3 as a backend for states.
Reading them produce a "no state" error and stop the scan.

How to reproduce
create an empty inside a bucket using aws web console. You may add statefile in it.
Tun scan with this bucket as a backend.

@moadibfr moadibfr added the kind/bug Something isn't working label Apr 6, 2021
lotoussa pushed a commit that referenced this issue Apr 7, 2021
- Ignore directory (size <= 0) when listing bucket object
- Add test for empty directory
lotoussa pushed a commit that referenced this issue Apr 7, 2021
- Ignore directory (size <= 0) when listing bucket object
- Add test for empty directory
@lotoussa lotoussa self-assigned this Apr 7, 2021
@lotoussa lotoussa added this to the v0.7.1 milestone Apr 7, 2021
@lotoussa lotoussa linked a pull request Apr 7, 2021 that will close this issue
lotoussa pushed a commit that referenced this issue Apr 7, 2021
- Ignore directory (size <= 0) when listing bucket object
- Add test for empty directory
lotoussa pushed a commit that referenced this issue Apr 7, 2021
- Ignore directory (size <= 0) when listing bucket object
- Add test for empty directory
eliecharra added a commit that referenced this issue Apr 7, 2021
Fix #409 do not list directory when using s3 as state backend
@eliecharra eliecharra assigned sjourdan and unassigned lotoussa Apr 7, 2021
@sjourdan
Copy link
Contributor

LGTM

 LOG_LEVEL=info driftctl scan --from tfstate://./vpc/terraform.tfstate  --from tfstate+s3://driftctl-tfstates/
INFO[0001] Start reading IaC
Scanning resources: ⣻ (0)
no state

vs

 LOG_LEVEL=info driftctl-0.7.1 scan --from tfstate://./vpc/terraform.tfstate  --from tfstate+s3://driftctl-tfstates/
INFO[0001] Start reading IaC
INFO[0002] Start scanning cloud provider
Scanned resources:    (62)
[...]

@mwarkentin
Copy link

Awesome, looking forward to taking another crack at this when it's available in a release!

@sjourdan
Copy link
Contributor

@mwarkentin 0.7.1 is just hours from being released :)

sundowndev pushed a commit that referenced this issue Apr 13, 2021
- Ignore directory (size <= 0) when listing bucket object
- Add test for empty directory
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
4 participants