fix(terraform-vault): pass vault_ca_bundle only when there is one - #178
Merged
Merged
Conversation
The cli path sent -var="vault_ca_bundle=..." unconditionally. Terraform ERRORS on a -var the root module does not declare, so that restricted this workflow to configs taking a CA bundle -- the cert issuer -- and any other Vault config failed before it started: Error: Value for undeclared variable A variable named "vault_ca_bundle" was assigned on the command line, but the root module does not declare a variable of that name. Hit by terraform/vault/eso-secrets, which creates a per-cluster KV mount and read policy and has no use for a PKI bundle. The credentials it runs with (openbao-labda.enc.yaml) carry no vaultCaBundle either, so the value would have been empty even where it was accepted. The dagger path already passes only cluster_name and kubeconfig_path, so it never had this limit -- an apply would have worked while a plan could not. This brings the cli path in line rather than adding a new behaviour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG
patrick-hermann-sva
added a commit
that referenced
this pull request
Sep 9, 2026
…ull" (#180) #178 made vault_ca_bundle conditional on the file being non-empty. It still went out, because the file is never empty: on a MISSING key `jq -r` prints the four-character string "null", not nothing. So /tmp/vault_ca_bundle contained "null", the -s test saw a non-empty file, and "null" was passed to terraform as the CA bundle -- reproducing the exact error #178 set out to fix. `// empty` makes a missing key yield nothing, which is what every caller here already assumed it did. Also guards the mask: ::add-mask:: on an empty value is a no-op warning, and on the old path it registered the word "null" as a secret to redact from every log line. Claude-Session: https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cli path sent
-var="vault_ca_bundle=..."unconditionally. Terraform errors on a-varthe root module does not declare, so that restricted this workflow to configs taking a CA bundle — the cert issuer — and any other Vault config failed before it started:Hit by
terraform/vault/eso-secrets, which creates a per-cluster KV mount and read policy and has no use for a PKI bundle. The credentials it runs with (openbao-labda.enc.yaml) carry novaultCaBundleeither, so the value would have been empty even where it was accepted.The two executors disagreed
The dagger path already passes only
cluster_nameandkubeconfig_path, so it never had this limit — anapplywould have worked while aplancould not. This brings the cli path in line rather than adding a new behaviour.Third in the same family as #175 and #177: the workflow was shaped around one terraform config, and each assumption only surfaces when a second config tries to use it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG