Skip to content

fix(config): don't warn about config permissions on Windows - #1077

Merged
Topherhindman merged 1 commit into
mainfrom
fix/lk-windows-config-permissions
Oct 23, 2026
Merged

Topherhindman merged 1 commit into
mainfrom
fix/lk-windows-config-permissions

Conversation

@Topherhindman

@Topherhindman Topherhindman commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Go reports mode 0666 for every writable file on Windows (0444 for a read-only one), so every lk command there warned that cli-config.yaml should be 0600. The warning couldn't be acted on either: chmod on Windows only sets the read-only bit. The check now runs only where file modes mean something, which is also how Helm treats its kubeconfig check. A new script, config-permissions-warning.txtar, pins the warning off Windows and its absence on Windows.

With the noise gone, TestScripts runs on Windows too:

  • testscript sets the Windows home directory through USERPROFILE, so setupScript sets it as well as HOME;
  • .gitattributes checks the scripts out with LF endings, as it already does for the TUI goldens, since their expected output is compared byte for byte.

Testing: go test ./pkg/config ./cmd/lk and golangci-lint pass. The Windows workflow runs TestScripts natively: the scripts pass there, with the same known-bug skips as on other platforms.

@Topherhindman
Topherhindman force-pushed the fix/lk-windows-config-permissions branch from 4481a71 to dfbcf1e Compare October 23, 2026 17:11
@Topherhindman
Topherhindman force-pushed the auth-tests/lk-auth-scripts branch 2 times, most recently from 7d625e4 to e07a424 Compare October 23, 2026 17:53
@Topherhindman
Topherhindman force-pushed the fix/lk-windows-config-permissions branch from dfbcf1e to 2adcef4 Compare October 23, 2026 17:53
Base automatically changed from auth-tests/lk-auth-scripts to main October 23, 2026 19:24
Go reports mode 0666 for every writable file on Windows (0444 for a
read-only one), so every lk command there warned that cli-config.yaml
should be 0600, and chmod there can't change it. The check now runs
only where file modes mean something; a script pins the warning off
Windows and its absence on Windows.

With the noise gone, TestScripts runs on Windows too: testscript sets
the Windows home directory through USERPROFILE, so setupScript sets it
as well as HOME, and the scripts are checked out with LF endings, as
the TUI goldens are, since their expected output is compared byte for
byte.
@Topherhindman
Topherhindman force-pushed the fix/lk-windows-config-permissions branch from 2adcef4 to 7119dd6 Compare October 23, 2026 19:39
@Topherhindman
Topherhindman merged commit 028278f into main Oct 23, 2026
25 checks passed
@Topherhindman
Topherhindman deleted the fix/lk-windows-config-permissions branch October 23, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants