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

Bump Terraform from 1.0.11 to 1.1.6 #4748

Merged
merged 4 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.58.0 --pr
### Terraform

USER root
ARG TERRAFORM_VERSION=1.0.11
ARG TERRAFORM_VERSION=1.1.6
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
RUN apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
&& apt-get update -y \
Expand Down
8 changes: 7 additions & 1 deletion terraform/lib/dependabot/terraform/file_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class FileUpdater < Dependabot::FileUpdaters::Base

PRIVATE_MODULE_ERROR = /Could not download module.*code from\n.*\"(?<repo>\S+)\":/.freeze
MODULE_NOT_INSTALLED_ERROR = /Module not installed.*module\s*\"(?<mod>\S+)\"/m.freeze
GIT_HTTPS_PREFIX = %r{^git::https://}.freeze

def self.updated_files_regex
[/\.tf$/, /\.hcl$/]
Expand Down Expand Up @@ -149,7 +150,12 @@ def run_terraform_init
output = e.message

if output.match?(PRIVATE_MODULE_ERROR)
raise PrivateSourceAuthenticationFailure, output.match(PRIVATE_MODULE_ERROR).named_captures.fetch("repo")
repo = output.match(PRIVATE_MODULE_ERROR).named_captures.fetch("repo")
if repo.match?(GIT_HTTPS_PREFIX)
repo = repo.sub(GIT_HTTPS_PREFIX, "")
repo = repo.sub(/\.git$/, "")
end
raise PrivateSourceAuthenticationFailure, repo
end

raise Dependabot::DependencyFileNotResolvable, "Error running `terraform init`: #{output}"
Expand Down