feat(oms): confirm secret changes in update install-config - #678
Merged
Conversation
Two changes to `oms update install-config`: It now generates the secrets an existing vault is missing. A vault written by an older oms predates whatever the current one requires, and nothing on the upgrade path fills the gap: `oms install` never touches secrets and `oms init install-config` writes a fresh vault rather than extending one. Strictly additive — every entry the vault already holds is kept, including the ones EnsureSecrets would otherwise overwrite. And it asks before it changes anything in the vault, listing what it would regenerate or generate first. `-y`/`--yes` approves up front; a run without a terminal answers no, so an unattended upgrade never rewrites a secret by itself. Declining a regeneration aborts the update — the certificates cover values that would otherwise already be in the config — while declining a missing secret just skips it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
Signed-off-by: NJona <25478046+NJona@users.noreply.github.com>
NautiluX
reviewed
Aug 12, 2026
Asking a yes/no question on stdin already existed as Prompter.Bool, so drop the second implementation in update install-config and use it. Confirm() is Bool with a false default, which is what a guard on a destructive change wants: an empty line, a closed stdin or a non-interactive prompter all count as no. The prompter has nothing to do with installing, so it moves out of internal/installer into internal/prompt. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
revive wants one on a new package, and the move from internal/installer made this one new. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
NautiluX
reviewed
Aug 12, 2026
Review follow-ups:
- Confirm was Bool with a false default and nothing else, so it is gone
again; the caller passes the default it wants.
- The command holds a Prompter rather than a func, with the interface next
to the implementation and a generated mock for the tests, like the rest
of the code. The concrete type is now StdinPrompter, so the interface
can carry the name, and the interactive collector takes it too.
- maybeAddMissingSecrets said nothing about what makes it a "maybe":
confirmAndAddMissingSecrets.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
NautiluX
approved these changes
Aug 13, 2026
NautiluX
left a comment
Member
There was a problem hiding this comment.
only two minor things about comments, lgtm otherwise
EnsureDefaultSecrets replaced whatever the vault held with "dummy" on every run, so an operator who set a real token lost it the next time anything called EnsureSecrets. It is the only secret in there that did not keep an existing value; the reason given was that the chart needs a non-empty value, which is satisfied by filling in an entry that is missing or empty. That was also the only thing standing between addMissingSecrets and a plain "generate what is not there", so it loses the snapshot it took to undo the overwrite, along with the paragraph explaining why it needed one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.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.
Two changes to
oms update install-config:It now generates the secrets an existing vault is missing. A vault written by an older oms predates whatever the current one requires, and nothing on the upgrade path fills the gap:
oms installnever touches secrets andoms init install-configwrites a fresh vault rather than extending one. Strictly additive — every entry the vault already holds is kept, including the ones EnsureSecrets would otherwise overwrite.And it asks before it changes anything in the vault, listing what it would regenerate or generate first.
-y/--yesapproves up front; a run without a terminal answers no, so an unattended upgrade never rewrites a secret by itself. Declining a regeneration aborts the update — the certificates cover values that would otherwise already be in the config — while declining a missing secret just skips it.