Commit Graph

15 Commits

Author SHA1 Message Date
Kevinz857
d88d61bffb feat: add switch control when watching events whether deserialization is required
This PR adds an option to disable automatic deserialization in the Watch stream().
By allowing clients to opt-out of automatic deserialization when only basic
JSON parsing is needed, we can significantly reduce time cost and improve
event processing throughput. This is particularly important in scenarios with
high event volumes or resource constraints.

Key changes:
- Added a 'deserialize' parameter to Watch.stream() method (defaults to True for backward compatibility)
- When deserialize=False, events are only JSON parsed without model conversion
- Maintains the original behavior when deserialize=True
- Added test cases to verify both behaviors
2025-05-31 18:33:21 +08:00
Raj Bhargav
d451d2fc7a
Update watch_test.py
As per request added few empty lines to test case in watch_test.py
2025-03-20 11:23:23 +05:30
Raj Bhargav
f4d0842d0e
Update watch.py
Changes made in watch.py to print multiple empty line if necessary.
2025-03-20 11:21:20 +05:30
Raj Bhargav
1e093d04aa
Update watch_test.py
Changes made to check whether entire log is printed or not.
2025-03-20 01:44:56 +05:30
Raj Bhargav
1268769cc0
Update watch_test.py
Removed pod_manifest from watch_test.py.
2025-03-20 00:27:16 +05:30
Raj Bhargav
f0a73c8824
Update watch.py
Changes made in unmarshal_event for not having issues with empty lines.
2025-03-19 14:15:44 +05:30
Raj Bhargav
3cee537e63
Update watch_test.py
Added a unit test name test_pod_log_empty_lines to check if watch is printing empty lines. And made changes in test_watch_with_interspersed_newlines as the watch is also printing empty line. Added a condition to check for empty lines in ogs to avoid the errors.
2025-03-18 13:46:41 +05:30
Raj Bhargav
d1adc8a544
Changes for issue 2358
Changes made in wacth.py to print Empty newlines that are skipped when watching pod logs.
2025-03-08 20:45:32 +05:30
Rafał
51d65dec05
Merge branch 'kubernetes-client:master' into patch-1 2024-08-29 15:15:04 +02:00
Rafał
f6c65df10f
Avoid shadowing important built-ins 2023-12-01 17:03:15 +01:00
David E
934d026788
Handled UTF-8 edge cases in Watch 2023-08-07 12:20:31 -07:00
harshitasao
f1dfdbba45 used unittest.mock instead of mock 2022-05-23 14:35:09 +05:30
Yu Liao
9d176918a9 removed submodule 2022-01-07 16:17:39 -08:00
mbohlool
dd30fe6a70 Remove base folder to prepare for submodule model 2017-05-19 00:21:35 -07:00
mbohlool
1ebceb6460 Move manual code to a base folder to prepare for repo splitting. 2017-05-09 16:26:27 -07:00