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

Add keilerkonzept/terraform-module-versions #1674

Closed
nitrocode opened this issue Sep 22, 2021 · 5 comments · Fixed by #1835
Closed

Add keilerkonzept/terraform-module-versions #1674

nitrocode opened this issue Sep 22, 2021 · 5 comments · Fixed by #1835

Comments

@nitrocode
Copy link
Member

nitrocode commented Sep 22, 2021

https://github.com/keilerkonzept/terraform-module-versions

Note: This may pull in pre-release versions so each version bump should be checked to make sure the latest versions are non-pre-release.

✗ go get https://github.com/keilerkonzept/terraform-module-versions
✗ terraform-module-versions list components/terraform/alb-controller/
|   TYPE   |     NAME     | CONSTRAINT | VERSION |                       SOURCE                       |
|----------|--------------|------------|---------|----------------------------------------------------|
| registry | this         | 0.25.0     | 0.25.0  | cloudposse/label/null                              |
| registry | eks_iam_role | 0.10.1     | 0.10.1  | cloudposse/eks-iam-role/aws                        |
| registry | eks          | 0.19.0     | 0.19.0  | cloudposse/stack-config/yaml//modules/remote-state |
| local    | iam_roles    |            |         | ../account-map/modules/iam-roles  
✗ terraform-module-versions check .
| UPDATE? |       NAME        | CONSTRAINT | VERSION | LATEST MATCHING | LATEST |
|---------|-------------------|------------|---------|-----------------|--------|
| (Y)     | kms_key_efs       | 0.11.0     | 0.11.0  |                 | 0.12.0 |
| (Y)     | eks               | 0.21.1     | 0.21.1  |                 | 0.22.0 |
| (Y)     | gbl_dns_delegated | 0.21.1     | 0.21.1  |                 | 0.22.0 |
| (Y)     | vpc               | 0.21.1     | 0.21.1  |                 | 0.22.0 |

Credit @srhopkins for mentioning this golang tool

@sgreben
Copy link

sgreben commented Nov 12, 2021

@nitrocode thanks for the proposal :) should it maybe have pre-release versions behind a flag and ignore those by default? --pre-release or something

@nitrocode
Copy link
Member Author

Hi @sgreben. Thanks for building this tool. i think pre-releases should be ignored by default and should be shown only when there is a flag present like the one you suggested above.

@nitrocode
Copy link
Member Author

@sgreben is there a way to show a non zero exit code when checking a root module's module versions?

@sgreben
Copy link

sgreben commented Nov 13, 2021

@nitrocode re:nonzero exit - yeah, there are the flags

 -any-updates-found-nonzero-exit=false  exit with a nonzero code when modules with updates are found (ignoring version constraints)
  -n=false                               (alias for -any-updates-found-nonzero-exit)
  -updates-found-nonzero-exit=false      exit with a nonzero code when modules with updates matching are found (respecting version constraints)
  -e=false                               (alias for -updates-found-nonzero-exit)

so e.g. terraform-module-versions check -n . will return with a nonzero exit code. The difference between -e and -n is whether the updates must match the constraint specified in the version parameter of the respective module call.

@sgreben
Copy link

sgreben commented Nov 13, 2021

@nitrocode i just added --pre-release (false by default) in the last release. Unless that is set, pre-release versions are not considered :)

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 a pull request may close this issue.

2 participants