config.ClearToken creates a config file when none exists (not a no-op) #595
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#595
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?
ClearTokenininternal/tpagectl/config/config.gois documented as "a no-op when no config file is present", butresolveConfigalways returns the default user config path when no file is found, so thepath == ""guard never triggers.ClearTokentherefore creates a config file (defaults + emptyserver.token) at the default path even when none existed.TestClearTokenNoFilepasses for the wrong reason: it checks the working directory for.tpagectl.yaml, but the file is written to the real user config dir (os.UserConfigDir()), which also pollutes the developer's config duringgo test.Track whether a config file was actually read (e.g. a
hadFileflag returned byresolveConfig) and return early when there is none.See #588
Fixed in #634:
config.ClearTokenreturns early (viaos.Stat) when no config file exists, sotoken setno longer creates an empty config file.