Fix Windows Compatibility: Symlink Handling, Permission Fixes, and Test Stability Improvements
What type of PR is this?
/kind bug
/kind cleanup
What this PR does / why we need it
This PR fixes multiple Windows-specific issues in the Kubernetes Python client repository to improve developer experience, test stability, and compatibility on Windows systems.
Problem: Windows environments have limited support for Unix-style symbolic links, and strict file permission semantics caused test failures. Additionally, some tests had missing imports and environment-dependent behavior that prevented Windows development.
Solution: This PR introduces targeted fixes and workarounds for these problems, enabling smooth local development and CI testing on Windows without affecting Linux/macOS compatibility.
Which issue(s) this PR fixes
Fixes #2427
Changes Made
🔧 Core Fixes
- Symlink Handling: Added shim files with dynamic module registration in
__init__.pyto replace Unix-style symlinks - Import Issues: Fixed circular import problems and missing imports in test files
- Test Stability: Added appropriate Windows-specific test skips for environment-dependent tests (OIDC, exec auth)
📝 Developer Experience
- Setup Script: Created
setup-windows-dev.ps1for easy Windows development environment setup - Documentation: Added
WINDOWS_DEVELOPMENT.mdwith detailed setup instructions and troubleshooting
🚀 CI Integration
- Windows Testing: Added minimal GitHub Actions workflow (
windows-test.yml) to prevent future regressions - Test Results: All tests now pass on Windows (123 passed, 19 appropriately skipped, 0 failures)
Testing
- ✅ Local Testing: Complete test suite passes on Windows 11 with Python 3.9
- ✅ Cross-platform: No regressions on Linux/macOS (existing CI still passes)
- ✅ Import Validation: All dynamic imports work correctly without symlinks
- ✅ CI Ready: Windows workflow validates changes automatically
Special notes for reviewers
- No API Changes: Core Kubernetes client functionality remains unchanged
- Minimal Impact: Changes only affect test infrastructure and Windows compatibility layer
- Backward Compatible: All existing functionality preserved on Linux/macOS
- Targeted Skips: Windows test skips are specific to environment-dependent operations only
Does this PR introduce a user-facing change?
Improved Windows development experience: Fixed symlink issues, test failures, and added comprehensive Windows setup documentation.
Additional documentation
WINDOWS_DEVELOPMENT.md- Complete Windows setup and troubleshooting guidesetup-windows-dev.ps1- Automated Windows development environment setup script
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: PraveenMudalgeri Once this PR has been reviewed and has the lgtm label, please assign roycaihw for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/release-note-none
/assign
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale