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

Fix Terraform secrets parsing for older TF version #1705

Merged
merged 2 commits into from
Mar 30, 2023
Merged

Conversation

amarthadan
Copy link
Contributor

I needed to use regex function instead of startswith because the older Terraform 0.12 used for Airnode v0.10 doesn't support it.

Also includes fixes for Docker image builds.

The new regex explenation:
Screenshot_20230329_175437

@@ -10,7 +10,7 @@ locals {
# Trim whitespaces from the line
secrets_lines_trimmed = [for line in local.secrets_lines : trimspace(line)]
# Discard commented lines (starting with '#')
secrets_lines_uncommented = [for line in local.secrets_lines_trimmed : line if !startswith(line, "#")]
secrets_lines_uncommented = [for line in local.secrets_lines_trimmed : line if can(regex("^[^#]+.*$", line))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: The + is not necessary in that regex.

Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

👍 LGTM, but didn't test.

@amarthadan amarthadan merged commit 4502238 into v0.10 Mar 30, 2023
@amarthadan amarthadan deleted the terraform-fix branch March 30, 2023 06:44
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 this pull request may close these issues.

2 participants