Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Learned Go in 3 Weeks. Yesterday, My Code Merged into k9s

说明与用途

k9s 通过同时检查 create 和 get 权限,修复了端口转发授权问题,恢复了仅拥有 get 权限用户的功能。

问题

k9s incorrectly checked only the create verb for pod port‑forwarding, blocking users with get‑only RBAC on Kubernetes 1.31+ WebSocket path.

结果

k9s now correctly authorizes port‑forwarding for both SPDY and WebSocket paths, restoring functionality for users with get‑only RBAC and maintaining backward compatibility.

工作流

  • Read issue #4144 and reproduction steps
  • Read k9s source and tests to understand current logic
  • Learned HTTP/1.1 upgrade vs WebSocket protocol differences
  • Implemented dual verb check in port_forwarder.go
  • Added comprehensive test suite covering all permission combinations
  • Ran go test -race to catch data races
  • Submitted PR and iterated through review rounds
  • Merged PR within 48 hours

证据

I changed one word and called it a day… I replaced one hardcoded verb with another…

来源

The error was a data race in the mock client…

来源

I didn’t know what an HTTP/1.1 Upgrade was…

来源

  • 记录日期: 2026-09-06T09:22:22.530Z