🐛 fix: restore auth smoke test by fixing gitops package build#18012
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole canceled.
|
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
Add missing helper functions for GitOps handlers package. The auth smoke test was failing during build due to undefined functions in the gitops subpackage. This fix adds a helpers.go file that provides the required functions that were available in the parent handlers package. Fixed undefined symbols: - requireAdmin (argo.go:69) - waitWithDeadline, maxResponseDeadline (handler.go:614) - isDemoMode, streamDemoSSE, errNoClusterAccess (operators.go:112-117) - writeSSEEvent, handleK8sError (operators.go:131-147) - maxK8sNameLen (validation.go:45) Signed-off-by: Scanner Bot <scanner@kubestellar.io>
9c51bf8 to
4fd3caa
Compare
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Fixes #18011
The auth smoke test was failing at the build step due to missing functions and constants in the gitops sub-package after PR #17978 refactored it into a separate package.
Changes
pkg/api/handlers/gitops/helpers.gowith functions moved from parent handlers package:requireAdmin,isDemoMode,errNoClusterAccess,waitWithDeadlinewriteSSEEvent,streamDemoSSE,handleK8sErrormaxResponseDeadline,maxK8sNameLenconstantsmaxK8sNameLeninpkg/api/handlers/validation.goWhat the auth smoke test validates
/auth/refreshbody contains{ refreshed: true, onboarded }onlykc_authcookie, NOT in the response bodyKC_AGENT_TOKEN(401)/api/agent/tokenreturns the same token kc-agent was started with/api/agent/tokenrequires authentication (no token leak)/auth/refreshrejects expired/invalid cookiesfetch()calls to agent URLs bypassagentFetch()Build and lint validation will be performed by CI.