tpagectl: offline commands fail when server config is invalid #582
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd#582
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
tpagectl versionruns the root command'sBeforehook, which loads the config and constructs the HTTP client (newClientincmd/tpagectl/main.go). Theversioncommand never talks to the daemon, yet a misconfigured or invalid--serverURL (or broken config file) would makeversionfail before its action runs.Suggested fix: skip client construction for commands that don't need it (e.g. make
version,--help, andcompletionbypass the client in the Before hook), or defer client construction to the commands that require it.Ref: PR #581
Fixed in #634: offline commands (
version,help,completion,docs, any--examples) skip config/client bootstrap viaofflineCommand, so they succeed even with a broken config or unusable--server.