shouldFallbackToSPDY reports whether a failed WebSocket streaming attempt should be retried over SPDY. This mirrors kubectl's own fallback predicate: a WebSocket upgrade failure (e.g. an API server or container runtime that does not support the V5 WebSocket subprotocol, as on some OpenShift versions
(err error)
| 181 | // proxy dial failure is detected separately. Both indicate the connection was |
| 182 | // never established over WebSocket and is safe to retry over SPDY. |
| 183 | func shouldFallbackToSPDY(err error) bool { |
| 184 | return httpstream.IsUpgradeFailure(err) || httpstream.IsHTTPSProxyError(err) |
| 185 | } |
| 186 | |
| 187 | // execCommandOnce performs a single kubectl exec operation without retries |
| 188 | func execCommandOnce( |