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 failure when no backend specified (#8) #9

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

neomantra
Copy link
Contributor

This change sets the ports list to [""] when backend_params is empty.

Ideally this would be done with an expression like:

"${length(var.backend_params) == 0 ? "" : element(split(",", element(var.backend_params, count.index)), 2)}"

But because of a limitation with HCL, it cannot be done and we've resorted
to the trick described in this issue:

hashicorp/hil#50 (comment)

The pipe | delimiter is used because it is not valid to use in GCP names.

Contributed according to the Google CLA.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@neomantra
Copy link
Contributor Author

I already signed it as a corporate entity (Neomantra Corp) and am the Point of Contact. Thanks!

This change sets the `ports` list to [""] when `backend_params` is empty.

Ideally this would be done with an expression like:
```
"${length(var.backend_params) == 0 ? "" : element(split(",", element(var.backend_params, count.index)), 2)}"
```

But because of a limitation with HCL, it cannot be done and we've resorted
to the trick described in this issue:

hashicorp/hil#50 (comment)

The pipe `|` delimiter is used because it is not valid to use in GCP names.

Contributed according to the Google CLA.
@googlebot
Copy link

CLAs look good, thanks!

@danisla
Copy link
Contributor

danisla commented Sep 26, 2018

Sorry about the long delay on this one, LGTM. Thanks

@danisla danisla merged commit e545711 into terraform-google-modules:master Sep 26, 2018
@hyww
Copy link
Contributor

hyww commented Oct 5, 2018

This merge seems conflict with 45c9c34

Mod behavior of element() is used in 45c9c34 , thus appending extra elements to the original list should be avoided.

@neomantra neomantra deleted the issue8 branch October 5, 2018 13:14
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.

4 participants