mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
fix: correct RBAC verb and WebSocket fallback for pods/exec This commit fixes three related issues that prevented exec collectors from working with minimal RBAC permissions: 1. RBAC preflight check used wrong verb for pods/exec Changed from "get" to "create" in v1beta1 and v1beta2 AccessReviewSpecs. The pods/exec subresource requires "create" to execute commands. 2. WebSocket fallback used wrong httpstream package import The fallback executor checked IsUpgradeFailure using the apimachinery httpstream package, but the roundtripper creates UpgradeFailureError using the streaming httpstream package. These are different Go types, so errors.As always returned false and fallback to SPDY never triggered. Changed import to k8s.io/streaming/pkg/httpstream. 3. Stdin mismatch caused SPDY fallback to hang PodExecOptions always set Stdin:true but StreamOptions always passed Stdin:nil. When WebSocket failed and fell back to SPDY, the server waited for stdin data that never arrived. Changed Stdin to false in PodExecOptions for exec, copy, and copy_from_host collectors.