Repository navigation
fix(config): treat allow_unsynced_clock as live in requires_reboot - #317
Merged
Merged
Conversation
The signer reads pki.allow_unsynced_clock from the stored config on every signing request, and nothing reads it at boot, so a change to it alone takes effect at once. ConfigStore.Apply still answered requires_reboot=true for it. Class it as hot next to allow_unverified_revocation_url. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Contributor
Author
|
Merging for the v0.1.0 test run: CI green and mergeable at merge time. |
Merged
4 tasks done
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 and why
pki.allow_unsynced_clocklifts the signing clock gate. The signer reads it from the stored config on every signing request (CASigner.checkClock, through the live config getter), and nothing reads it at boot: the clock gate wired into the signer only reports whether the time source has synced, and the SNTP engine never looks at the flag. So a change to the flag alone already takes effect at once, butconfig applystill answeredrequires_reboot=truefor it andcryptosctl statusshowedReboot: pendingfor nothing.This classes it as a live field in
NeedsReboot, next topki.profiles,pki.root_leaf_issuanceandpki.allow_unverified_revocation_url, the same way #307 did for the revocation override. Any other field in the same apply still needs a reboot.internal/config/reboot.go: blankAllowUnsyncedClockinhotNormalized, and list it in the doc comment.internal/init/run.go,internal/node/providers.go: the comments naming the live fields list it too.docs/time-sync.md: says a change to it alone takes effect at once withrequires_reboot=false.Refs #301
Docs: CryptOS-PKI/docs#63 updates the pages that list the live fields.
Merge order: merge CryptOS-PKI/docs#59 first (the companion of #307), then this PR together with CryptOS-PKI/docs#63, which is branched from #59's branch.
Verification
How this was verified
TestConfigStoreApply_AllowUnsyncedClockIsLiveseeds a stored config, reads it back withConfigStore.Current, flips onlypki.allow_unsynced_clock(on, then off) and sends it throughConfigStore.Apply. It failed before the fix withsetting only allow_unsynced_clock=true answered requires_reboot(and the same forfalse), and passes after. A matching subtest inTestNeedsRebootLiveFieldsgoes through the store and a protobuf wire round trip.task ci(fmt, golangci-lint, vet,go test ./..., build) passes locally, andtask licenseexits 0 with the CryptOS Authors header on the new test file.