Skip to content

Conversation

@anurag4DSB
Copy link

@anurag4DSB anurag4DSB commented Sep 27, 2025

Implements CSI daemon detection to prevent Mountpoint Pod creation on nodes without the CSI driver running, adds node ID tracking in watchers for node-specific activity monitoring, and improves test infrastructure with proper mocking and CSINode objects for reliable integration testing.

@anurag4DSB anurag4DSB changed the title S3CSI-184: Add node ID in watcher for the nodes to watch activity on S3CSI-184: Add node ID in watcher for the nodes to watch activity on and Add CSI daemon detection to controller Sep 27, 2025
@codecov
Copy link

codecov bot commented Sep 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.57%. Comparing base (52a70e3) to head (c7d6578).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
pkg/driver/driver.go 46.83% <100.00%> (+0.33%) ⬆️
pkg/driver/node/mounter/pod_mounter.go 57.01% <100.00%> (+0.87%) ⬆️
pkg/driver/node/mounter/pod_unmounter.go 71.60% <ø> (ø)
pkg/podmounter/mppod/watcher/watcher.go 85.07% <100.00%> (+5.70%) ⬆️

... and 1 file with indirect coverage changes

@@                                    Coverage Diff                                     @@
##           feature/S3CSI-179-single-atomic-switch-v2-architecture     #242      +/-   ##
==========================================================================================
+ Coverage                                                   71.44%   71.57%   +0.13%     
==========================================================================================
  Files                                                          47       47              
  Lines                                                        3274     3279       +5     
==========================================================================================
+ Hits                                                         2339     2347       +8     
+ Misses                                                        814      812       -2     
+ Partials                                                      121      120       -1     

- Implement CSINode-based detection before creating Mountpoint Pods
- Add ConfigMap fallback for additional node status tracking
- Integrate EventRecorder for clear user feedback via Kubernetes events
- Update RBAC to include CSINode and ConfigMap read permissions
- Add comprehensive tests for CSI detection scenarios
- Optimize for OpenShift/ROSA with SELinux enforcing mode

This prevents workload pods from getting stuck in ContainerCreating state
when scheduled on nodes without the S3 CSI daemon installed, improving
user experience and resource efficiency.
- Add PodWatcher interface to enable dependency injection
- Update PodMounter to use interface instead of concrete watcher type
- Implement mock PodWatcher for unit tests to avoid K8s dependencies
- Fix socket communication in tests using simplified mock approach
- Update pod_unmounter tests to implement Wait method in mock
- Remove unused setMountOptions method

This change fixes unit test failures caused by tests attempting to
interact with real Kubernetes resources. The tests were timing out
waiting for pod state transitions and socket communication that would
never occur without a real cluster.

By introducing the PodWatcher interface and mock implementation, tests
now run as true unit tests without external dependencies, making them
faster and more reliable.
@anurag4DSB anurag4DSB force-pushed the improvement/S3CSI-184-Enhanced-Pod-Watcher-with-NodeID branch from 708bf79 to c7d6578 Compare September 28, 2025 11:43
@anurag4DSB anurag4DSB marked this pull request as ready for review September 28, 2025 11:45
@anurag4DSB
Copy link
Author

closoijng in favor of #244

@anurag4DSB anurag4DSB closed this Sep 29, 2025
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