-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configs/configupgrade: do not panic on HEREDOCs. (#20281)
Previously, configupgrade would panic if it encountered a HEREDOC. For the time being, we will simply print out the HEREDOC as-is. Unfortunately, we discovered that terraform 0.11's version of HCL allowed for HEREDOCs with the termination delimiter inline (instead of on a newline, which is technically correct). Since 0.12configupgrade needs to be bug-compatible with terraform 0.11, we must roll back to the same version of HCL used in terraform 0.11.
- Loading branch information
1 parent
6eb7bfb
commit 5f8916b
Showing
15 changed files
with
171 additions
and
167 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
configs/configupgrade/test-fixtures/valid/heredoc/input/heredoc.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
locals { | ||
cert_options = <<EOF | ||
--cert-file=/etc/ssl/etcd/server.crt \ | ||
--peer-trusted-ca-file=/etc/ssl/etcd/ca.crt \ | ||
--peer-client-cert-auth=trueEOF | ||
} | ||
output "local" { | ||
value = "${local.cert_options}" | ||
} |
11 changes: 11 additions & 0 deletions
11
configs/configupgrade/test-fixtures/valid/heredoc/want/heredoc.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
locals { | ||
cert_options = <<EOF | ||
--cert-file=/etc/ssl/etcd/server.crt \ | ||
--peer-trusted-ca-file=/etc/ssl/etcd/ca.crt \ | ||
--peer-client-cert-auth=trueEOF | ||
} | ||
output "local" { | ||
value = local.cert_options | ||
} |
3 changes: 3 additions & 0 deletions
3
configs/configupgrade/test-fixtures/valid/heredoc/want/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = ">= 0.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.