Commit e272e2c
authored
fix: handle ContentTypeError in dynamic client discovery (#368)
* fix: handle ContentTypeError in dynamic client discovery
When the Kubernetes API server returns a 503 Service Unavailable with text/plain
content type instead of JSON, the dynamic client was failing with a ContentTypeError
while trying to parse the response. This fix catches ContentTypeError in the
get_resources_for_api_version method and handles it the same way as ServiceUnavailableError,
allowing the client to gracefully continue with an empty resources list.
This resolves issues when accessing certain API endpoints that may temporarily
return non-JSON responses during service unavailability
* #368 - handle ContentTypeError in dynamic client discovery
Fix import sorting
* #368 - handle ContentTypeError in dynamic client discovery
Fix import sorting1 parent 83185db commit e272e2c
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
186 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
| |||
0 commit comments