Conversation
PATCH /api/v3/secrets/<name> updates the secret and marks change tracking for the linked nodes, but nothing bumps the version of the volume mounts that carry it. An agent only re-materialises a mount whose version is greater than the one it holds -- "Skipping update - new version 1 not greater than current version 1" in its journal -- so every linked node keeps the old content indefinitely. Any rotation of publisher keys, credentials or TLS material looks applied in the controller and is not applied on the fleet. Measured on Controller 3.8.2 with Edgelet v1.0.3-rc.1, on a node linked to a secret-backed volume mount: adding a key through the secrets API alone changed nothing on the node, and only a PATCH of the volume mount (which does bump the version) made it arrive. With this change the same API call moved the version and the node had the new file about 30 s later; removing the key propagated the same way. updateSecretEndpoint now bumps every volume mount that references the secret, in the same transaction that writes it. Unconditional rather than "only when the data differs", because the stored copy lives in the vault and comparing it with the request body is not a hash of the request body. No API change. Signed-off-by: Nilson.Henao <nilsonfh@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <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.
What this fixes
PATCH /api/v3/secrets/<name>updates the secret and marks change tracking for thelinked nodes, but nothing bumps the version of the volume mounts that carry it. An
agent only re-materialises a mount whose version is greater than the one it holds —
Skipping update - new version 1 not greater than current version 1in its journal —so every linked node keeps the old content indefinitely.
The effect is that any rotation of publisher keys, credentials or TLS material looks
applied in the Controller and is not applied on the fleet.
updateSecretEndpointnow bumps every volume mount that references the secret, insidethe same transaction that writes it.
How it was found
Measured on Controller 3.8.2 with Edgelet v1.0.3-rc.1, on a node linked to a
secret-backed volume mount used to distribute container-signature public keys:
as it was left alone.
PATCH /api/v3/volumeMounts/<name>— which does bump the version — made thenew key arrive, which is the workaround the lab's tooling had to carry.
had the new file about 30 s later. Removing the key propagated the same way.
Why the bump is unconditional
A
PATCHis an explicit instruction to set this secret, and the stored copy lives inthe vault, so "bump only when the data differs" is not a hash of the request body. An
attempt at the conditional version also behaved differently depending on which of the
request's two executions ran first — a
PATCHwith new data bumped the version twiceand one with identical data once, although the route is registered once and its
middleware calls the endpoint once. That duplication is worth a look on its own and is
unrelated to this fix; an agent only needs a strictly greater version and
re-materialises once per change it sees.
Scope and risk
One file, 21 added lines, no API change. A node re-reads a secret-backed mount after
its secret is updated, which is the documented intent of the endpoint.
Verification
npx standard@17clean on the changed file (same version as the repo'sdevDependency).
Note:
npm cifails ondevelopfor an unrelated reason (ERESOLVE:sinon-chai@3.7.0wantschai@">=2.1.2 <6", the tree haschai@5.1.1viachai-as-promised), so the test suite was not run here.🤖 Generated with Claude Code