terraform-linters / tflint-bundle Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: A Docker image with TFLint and ruleset plugins
License: MIT License
DEPRECATED: A Docker image with TFLint and ruleset plugins
License: MIT License
running on gitlab it appears tflint has trouble finding some modules, inconsistently. I have checked gitlab cache and also tried changing from latest image to last. Not sure what more I can do to help figure out what is going on. Other tf steps in the same pipeline do not complain about modules not being loaded.
Issue has started in the last few weeks or so.
The dockerfile should initialize tflint plugins by running tflint --init
before the main tflint
entrypoint.
Hi There,
I hope you are doing well, I have noticed a slight issue with a recent commit in tflint-bundle
tflint started erroring with exit 2
after the commit.
I have set our image version from latest
back to v0.39.3.2
and it is working as expected.
# Local command
tflint --enable-plugin=aws
# From Docker
docker run -it --rm --init --volume /<OBFUSCATED>:/workdir --workdir /workdir --entrypoint /bin/sh ghcr.io/terraform-linters/tflint-bundle:latest -ec $'tflint --enable-plugin=aws\n'
09:45:33 [DEBUG] [email protected]/grpc_stdio.go:139: stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
09:45:33 [INFO] [email protected]/client.go:646: plugin process exited: path=/<OBFUSCATED>/.tflint.d/plugins/github.com/terraform-linters/tflint-ruleset-aws/0.17.0/tflint-ruleset-aws pid=37964
09:45:33 [DEBUG] [email protected]/client.go:461: plugin exited
09:45:33 [DEBUG] [email protected]/grpc_stdio.go:139: stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
09:45:33 [INFO] [email protected]/client.go:646: plugin process exited: path=/usr/local/bin/tflint pid=37965
09:45:33 [DEBUG] [email protected]/client.go:461: plugin exited
Today all of our Terraform pipelines started failing on tflint
(v0.39.0.0):
I was able to reproduce this locally by running the following:
❯ docker run --rm -v $(pwd):/data -t ghcr.io/terraform-linters/tflint-bundle
Unable to find image 'ghcr.io/terraform-linters/tflint-bundle:latest' locally
latest: Pulling from terraform-linters/tflint-bundle
530afca65e2e: Already exists
a70a19e69755: Pull complete
8f9b3e47c202: Pull complete
82a17f85f628: Pull complete
3f6d410d8bd8: Pull complete
Digest: sha256:e32e4adae6f0d37e942d12523b785f46bd2f20d3ddb44ef193d180908903dfac
Status: Downloaded newer image for ghcr.io/terraform-linters/tflint-bundle:latest
Failed to check ruleset; file not found
The previous version (v0.38.1.0) works fine:
❯ docker run --rm -v $(pwd):/data -t ghcr.io/terraform-linters/tflint-bundle:v0.38.1.0
Unable to find image 'ghcr.io/terraform-linters/tflint-bundle:v0.38.1.0' locally
v0.38.1.0: Pulling from terraform-linters/tflint-bundle
2408cc74d12b: Already exists
f0290673f905: Pull complete
7b95f59d4b4e: Pull complete
9b4aa5dc042c: Pull complete
1b85d805286a: Pull complete
Digest: sha256:8aa1d7939bcf70ad76c577a8fb9fc4bd21b75ecc195807f613c5b0bb7bbbec7b
Status: Downloaded newer image for ghcr.io/terraform-linters/tflint-bundle:v0.38.1.0
Failed to check ruleset; no valid credential sources for tflint-ruleset-aws found.
Please see https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/docs/deep_checking.md
for more information about providing credentials.
Error: NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
SharedCredsLoad: failed to load profile, .
EC2RoleRequestError: no EC2 instance role found
caused by: RequestError: send request failed
caused by: Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: no route to host
(the error is expected as I did not authenticate against AWS)
Currently the image manifest is only linux/amd64.
If possible, could it be both linux/amd64 + linux/arm64?
At the moment docker image runs as root
user when invoked.
I would suggest to use a non-privileged user in image by default.
Hi,
thanks a lot for your work on the tflint image!
I am running the image on the latest version of gitlab-runner and do get:
Executing "step_script" stage of the job script
00:01
Using docker image sha256:7bb16013e6077cb34a49d4f93b07f0eff81301f094e3a21231ea64856d01c860 for ghcr.io/terraform-linters/tflint-bundle:v0.41.0.1 with digest ghcr.io/terraform-linters/tflint-bundle@sha256:c1a9ab620e8d1473ee564a7b971a6fa02b7bc7a7d9842123c6fd0aac6548fe[18]...
Failed to parse CLI arguments; Failed to load `sh`: File not found
The logs of the container are empty.
This is how the gitlab pipeline stage looks like:
lint-modules:
stage: tflint
image: ghcr.io/terraform-linters/tflint-bundle:v0.41.0.1
script:
- tflint --init
- tflint modules/xyz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.