You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LCORE-511: Fix type checking issues in k8s authentication module
Fix type checking errors in `src/authentication/k8s.py` caused by incomplete
type annotations in the Kubernetes Python client library.
The Kubernetes Python client library (`kubernetes-client`) has incomplete type
annotations for many of its model classes and API responses. This PR adds
targeted type ignore comments to suppress false positives while maintaining type
safety for the rest of the codebase.
Changes:
- Added explicit type conversions for `k8s_config.host` and `k8s_config.ssl_ca_cert` to ensure proper string types
- Added `# type: ignore` directives for Kubernetes client objects that lack proper type stubs:
- `V1TokenReview.status` and `.user` attributes
- `V1SubjectAccessReview.status.allowed` attribute
- Custom object API responses (dict-like objects with dynamic structure)
- Added type assertions to help Pyright understand singleton initialization pattern
Note: There is no functional changes to authentication logic being introduced in this PR,
code behaviour remains identical.
Signed-off-by: Anik Bhattacharjee <anbhatta@redhat.com>
0 commit comments