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

Ensure matching modules with metadata when requested #21640

Merged
merged 8 commits into from
Jun 7, 2019

Conversation

pselle
Copy link
Contributor

@pselle pselle commented Jun 6, 2019

When explicitly requesting a module with metadata information (ex. 1.0+abc), go-version does not differentiate between versions based on build number. According to semver:

Build metadata SHOULD be ignored when determining version precedence.

So when comparing versions (including on equality) go-version will not factor in build/metadata, since it generally follows this spec.

As such, this PR adds a bit of logic to make sure that Terraform matches versions exactly when exact matches are requested for a version with metadata.

Addresses #20814

@pselle pselle requested a review from a team June 6, 2019 21:14
Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

Doing this at the Terraform layer seems like a nice compromise to allow us to fix it without potentially impacting other go-version users. 👍

I left a couple questions inline.

config/module/versions_test.go Outdated Show resolved Hide resolved
config/module/versions.go Outdated Show resolved Hide resolved
config/module/versions.go Outdated Show resolved Hide resolved
@pselle pselle merged commit f1541ad into hashicorp:master Jun 7, 2019
@ghost
Copy link

ghost commented Jul 25, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jul 25, 2019
@pselle pselle deleted the moduleswithmetadata branch August 9, 2019 20:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants