Skip to content

fix(infra): add the push-secrets row of the infra-drift SSH key - #7434

Merged
dan-petty merged 4 commits into
mainfrom
fix/7428-push-secrets-row-for-infra-ssh-key
Nov 27, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/7428-push-secrets-row-for-infra-ssh-key

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Add the push-secrets row of Secret devops/infra-ssh-key, which WorkflowTemplate infra-drift mounts as its Ansible SSH key. The table had no row, so the pod of each infra-drift Workflow stopped at the mount of ssh-key, and a person had no command to write the Secret.

The row holds one optional key, id_ed25519, from the new managed credential infra.ssh_private_key (keyring entry infra_ssh_private_key). A person stores the private key with devops config set infra.ssh_private_key --from-file <key-file>, which keeps its last newline. OpenSSH refuses a key without that newline, and keyring set removes it from a pipe. The row has no generator and restarts nothing: each Workflow pod mounts the Secret at its start. A push with no key skips this Secret with a warning and writes the other Secrets of the stack.

k8s/README.md (Cluster Secrets) and docs/CLUSTER.md (Infra drift) name the Secret, its key and its keyring source.

Closes #7428

Change: openspec/changes/archive/2026-11-27-7428-push-secrets-row-for-infra-ssh-key/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/infra Docker container images, DevContainers, and infrastructure tooling labels Nov 27, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Results

  • Base: uv run pytest -n 4 -q tests/k8s/test_cluster_secret_plan.py tests/k8s/test_cluster_secret_push.py tests/security/test_config_declarations.py with the new tests and the code of origin/main: 8 failed, 78 passed. The new tests failed with Unknown Secret: devops/infra-ssh-key or with no row.
  • uv run devops ci fail-to-pass --base origin/main: 9 changed tests fail on base and prove the fix (the 8 above and tests/commands/test_config_audit_keys.py::test_config_audit_keys_json_output), 0 errored.
  • uv run devops ci --check --only lint,format,typecheck,docs,openspec,test-tree,k8s: all pass.
  • uv run devops ci test tests/k8s/test_cluster_secret_plan.py tests/k8s/test_cluster_secret_push.py tests/security/test_config_declarations.py tests/commands/test_config_audit_keys.py tests/invariants/test_k8s_manifests.py tests/commands/test_config_cmd.py: 148 passed.
  • Live, read only, from this branch: uv run devops k8s push-secrets --plan --only devops/infra-ssh-key exits 0 and prints devops/infra-ssh-key: id_ed25519 (keyring infra_ssh_private_key) would skip; would restart: none, a warning that the keyring entry is empty, and wrote nothing. The keyring has no key yet.
  • OpenSSH_10.6p2: ssh-keygen -y -f loads a throwaway ed25519 key with its last newline and refuses it without that newline. keyring 25.7.0 keyring set removes the last newline of a pipe, so the person step uses devops config set --from-file.

Steps for a person

  1. Store the private key. The file is the newest <prefix>-id_ed25519-<YYYYMMDD> file of ssh.key_dir, where <prefix> is the ssh_key_prefix of the entries of infra.repos (default ansible):
    uv run devops config set infra.ssh_private_key --from-file <key-file>
  2. From a checkout of this branch, or after the release: uv run devops k8s push-secrets --only devops/infra-ssh-key --plan must print id_ed25519 (keyring infra_ssh_private_key) would create.
  3. uv run devops k8s push-secrets --only devops/infra-ssh-key
  4. argo submit -n devops --from cronwf/infra-drift, then argo get -n devops @latest. The pod must get past Init:0/1 with no new FailedMount event for ssh-key.

Follow-up

@dan-petty
dan-petty force-pushed the fix/7428-push-secrets-row-for-infra-ssh-key branch from 8ab7b77 to 20b4bcd Compare November 27, 2026 16:13
Secret devops/infra-ssh-key gets one optional key, id_ed25519, from the
new managed credential infra.ssh_private_key. A person stores the key
with devops config set --from-file, which keeps its last newline.
k8s/README.md (Cluster Secrets) and a new section Infra drift of
docs/CLUSTER.md name Secret devops/infra-ssh-key, its key id_ed25519,
the keyring entry infra_ssh_private_key and the commands of a person.
@dan-petty
dan-petty force-pushed the fix/7428-push-secrets-row-for-infra-ssh-key branch from 20b4bcd to d98fad7 Compare November 27, 2026 16:39
@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 17:21
@dan-petty
dan-petty merged commit c78b3cd into main Nov 27, 2026
29 checks passed
@dan-petty
dan-petty deleted the fix/7428-push-secrets-row-for-infra-ssh-key branch November 27, 2026 17:21
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.228.1](v0.228.0...v0.228.1)
(2026-11-27)


### Bug Fixes

* **infra:** add the push-secrets row of the infra-drift SSH key
([#7434](#7434))
([c78b3cd](c78b3cd))
* **repos:** onboard requires the checks of github/repository.yaml
([#7446](#7446))
([3067d6c](3067d6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/infra Docker container images, DevContainers, and infrastructure tooling type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(infra): push-secrets has no row for the infra-drift SSH key

1 participant