Repository navigation
Conversation
pruneCatalog picked the reports to drop from a snapshot taken before it listed the admitted nodes, then deleted them from the live map. A node whose session had lapsed could enroll again and report between the list and the delete, and lose its fresh report until its next push. Drop only an entry that is still the one the snapshot saw, and log the one kept.
pem.Decode skips a block whose body or BEGIN/END line is damaged and returns the next one, so a damaged first key left the second key signing, and a file read mid-write lost its last block, all without an error. The file is now refused unless every block it marks decodes, so a reload keeps the keys in use and counts the failure, as documented. Reading the keyring back after an install no longer turns a read error into an empty valid_after list: the failure is logged with its error.
Contributor
There was a problem hiding this comment.
Code Review
This pull request improves the robustness of node garbage collection and operator signing key management. In node_gc.go, the pruneCatalog function is updated to prevent dropping service reports of nodes that were re-admitted and reported during the sweep. In signingkeys.go, PEM decoding is made stricter by ensuring all marked PEM blocks decode successfully, preventing damaged or truncated keys from being silently skipped. Additionally, keyring reconciliation now properly handles and logs read-back failures instead of reporting empty keyrings. Corresponding unit tests have been added to verify these behaviors. I have no feedback to provide.
This branch has not been deployed
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.
Three control plane fixes in operator signing keys and node GC, each with a regression test that failed on the previous code.
pem.Decodeskips a block whose body or BEGIN/END line does not decode and returns the next one, so a damaged first key left the second key signing, and a file read mid-write lost its last block, without an error. The file is now refused unless every block it marks decodes, so a reload keeps the keys in use and counts the failure, assigningkeys.godocuments.valid_afterlist in the install log line. The failure is now logged with its error instead.pruneCatalogdeleted entries picked from a snapshot taken before it listed the admitted nodes, so a node that re-enrolled and reported in between lost its fresh report until its next push. Only an entry that is still the one the snapshot saw is dropped.go test -race ./internal/controlplane/ ./internal/standalone/andgo vetpass on Linux.