feat(terraform-vault): make the tfvars template and credential file inputs - #175
Merged
Merged
Conversation
…nputs ENCRYPTED_ENV and TFVARS_TEMPLATE were env constants, which tied this workflow to ONE terraform config: the cert issuer, whose tfvars needs a vaultCaBundle and whose credentials live under the vault-infra-<lab> name. That blocks any other Vault work. A per-cluster ESO KV mount and read policy needs different values for both, and on LabDA the credentials are in secrets/envs/openbao-labda.enc.yaml -- a file whose name the derived vault-infra-<lab> pattern cannot produce, and which carries no vaultCaBundle for the cert-issuer template to render. Both inputs default to exactly what was hardcoded, so every existing caller keeps its behaviour without naming either one. The fallback shape is load-bearing rather than cosmetic: workflow_dispatch does not define these inputs, so a dispatched run reads them as empty. Without the `!= '' && x || default` on BOTH, a dispatched run would render with no template file at all -- the first version of this change had that bug. 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
…rived
cluster-name has been doing two jobs: naming the cluster to terraform, and
locating its kubeconfig via
KUBE_CONFIG_ENC: secrets/kubeconfigs/${{ inputs.cluster-name }}.yaml
Those disagree in practice, because kubeconfigs are named inconsistently --
philly.yaml and cicd-crossplane.yaml carry no lab, labda-cicd-machinery-test5
and labda-sthings-infra do. A caller whose file is prefixed had to pass the
prefixed name, and then got that prefix into every Vault object the terraform
config names.
Concretely: cicd-machinery-test5 already has an ESO mount
`cicd-machinery-test5` and a k8s-auth mount `cicd-machinery-test5-eso`, but its
kubeconfig is labda-cicd-machinery-test5.yaml. No value of cluster-name
produced both.
kubeconfig-file defaults to empty and derives the old path, so nothing existing
changes. Same guard shape as #175 and for the same reason: workflow_dispatch
does not define the input, so a dispatched run reads it as empty and must fall
back.
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
…rived (#177) cluster-name has been doing two jobs: naming the cluster to terraform, and locating its kubeconfig via KUBE_CONFIG_ENC: secrets/kubeconfigs/${{ inputs.cluster-name }}.yaml Those disagree in practice, because kubeconfigs are named inconsistently -- philly.yaml and cicd-crossplane.yaml carry no lab, labda-cicd-machinery-test5 and labda-sthings-infra do. A caller whose file is prefixed had to pass the prefixed name, and then got that prefix into every Vault object the terraform config names. Concretely: cicd-machinery-test5 already has an ESO mount `cicd-machinery-test5` and a k8s-auth mount `cicd-machinery-test5-eso`, but its kubeconfig is labda-cicd-machinery-test5.yaml. No value of cluster-name produced both. kubeconfig-file defaults to empty and derives the old path, so nothing existing changes. Same guard shape as #175 and for the same reason: workflow_dispatch does not define the input, so a dispatched run reads it as empty and must fall back. 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.
ENCRYPTED_ENVandTFVARS_TEMPLATEwereenv:constants, which tied this workflow to one terraform config — the cert issuer:That blocks any other Vault work through this workflow. A per-cluster ESO KV mount and read policy needs different values for both, and on LabDA the credentials live in
secrets/envs/openbao-labda.enc.yaml— a name the derivedvault-infra-<lab>pattern cannot produce, and a file that carries novaultCaBundlefor the cert-issuer template to render.Backwards compatible by construction
Both inputs default to exactly what was hardcoded, so every existing caller keeps its behaviour without naming either one.
The fallback shape is load-bearing
workflow_dispatchdoes not define these inputs, so a dispatched run reads them as empty. Without the!= '' && x || defaultguard on both, a dispatched run would render with no template file at all.The first version of this change had exactly that bug —
TFVARS_TEMPLATE: ${{ inputs.tfvars-template }}alone — and it only shows up on the dispatch path, not the call path. Resolution was simulated for all three cases before pushing:secrets/envs/openbao-labda.enc.yamlsecrets/envs/vault-infra-labul.enc.yaml(unchanged)secrets/envs/vault-infra-labda.enc.yaml(unchanged)🤖 Generated with Claude Code
https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG