refactor: move bootstrap sequence into dedicated bootstrap.go#460
Open
Aditya-132 wants to merge 1 commit into
Open
refactor: move bootstrap sequence into dedicated bootstrap.go#460Aditya-132 wants to merge 1 commit into
Aditya-132 wants to merge 1 commit into
Conversation
Extract performBootstrapSequence and its helper functions from daemon.go into a new bootstrap.go file, with the matching tests moved to bootstrap_test.go. Set the status file paths in the RunCommand and DaemonCommand tests so prepareStatus can create its directory instead of failing on an empty path. Signed-off-by: Aditya-132 <adityachincholkar11@gmail.com>
Author
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.
Proposed changes
Refactors the bootstrap logic in the secure agent into its own file for
better separation of concerns:
performBootstrapSequenceand its helper functions(
discoverBootstrapURLs,doHandleBootstrapRedirect,doRequestBootstrapServerOnboardingInfo, etc.) out ofdaemon.gointo a new
bootstrap.go.daemon.gonow only holdsRunCommandDaemon.daemon_test.gointo a newbootstrap_test.go.RunCommandandDaemonCommandtests by setting the statusfile paths (
StatusFilePath,ResultFilePath,SymLinkDir) soprepareStatuscan create its directory instead of failing on anempty path (
mkdir "": no such file or directory).Closes #455
Types of changes
Checklist
appropriate)
Dependency
Special notes for your re
This is primarily a code-organization refactor with no behavior change to
the bootstrap flow. The only functional change is in the test setup: the
existing
RunCommand/DaemobecauseprepareStatus(added with the status command) needs valid status paths; they now uset.TempDir()` so the suite runs green.