Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

modules/bootkube: fix error when a CA cert/key is provided #128

Merged
merged 2 commits into from
Mar 27, 2017
Merged

modules/bootkube: fix error when a CA cert/key is provided #128

merged 2 commits into from
Mar 27, 2017

Conversation

Quentin-M
Copy link
Contributor

No description provided.

# NOTE: Across this module, the following syntax is used at various places:
#   `"${var.ca_cert == "" ? join(" ", tls_private_key.kube-ca.*.private_key_pem) : var.ca_key}"`
#
# Due to hashicorp/hil#50, both sides of conditions
# are evaluated, until one of them is discarded. Unfortunately, the
# `{tls_private_key/tls_self_signed_cert}.kube-ca` resources are created
# conditionally and might not be present - in which case an error is
# generated. Because a `count` is used on these ressources, the resources can be
# referenced as lists with the `.*` notation, and arrays are allowed to be
# empty. The `join()` interpolation function is then used to cast them back to
# a string. Since `count` can only be 0 or 1, the returned value is either empty
# (and discarded anyways) or the desired value.
@Quentin-M Quentin-M requested a review from alexsomesan March 24, 2017 18:55
@Quentin-M Quentin-M mentioned this pull request Mar 24, 2017
# are evaluated, until one of them is discarded. Unfortunately, the
# `{tls_private_key/tls_self_signed_cert}.kube-ca` resources are created
# conditionally and might not be present - in which case an error is
# generated. Because a `count` is used on these ressources, the resources can be
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ressources/resources

@alexsomesan alexsomesan merged commit ee60e9c into coreos:master Mar 27, 2017
@Quentin-M Quentin-M deleted the fix_provided_ca branch June 14, 2017 21:25
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.

3 participants