Skip to content

Fix: Extend Import Cluster CSR timeout#2407

Open
DhruvTotala wants to merge 1 commit intokubestellar:devfrom
DhruvTotala:issue(#2392)
Open

Fix: Extend Import Cluster CSR timeout#2407
DhruvTotala wants to merge 1 commit intokubestellar:devfrom
DhruvTotala:issue(#2392)

Conversation

@DhruvTotala
Copy link

@DhruvTotala DhruvTotala commented Feb 1, 2026

Description

This PR fixes a bug in the "Import Cluster" (Quick Connect) workflow where the operation frequently times out in environments with slower agent startup times.

Currently, the backend only checks for the Certificate Signing Request (CSR) briefly (~30 seconds). If the agent takes longer to start and generate the CSR, the import process hangs or fails. This change replaces the single-pass check with a polling loop that waits up to 5 minutes, ensuring robustness across various network and hardware conditions.

Related Issue

Fixes #2392

Changes Made

  • Modified approveClusterCSRs in backend/api/handlers.go.
  • Implemented a 5-minute timeout context to allow sufficient time for agent startup and CSR submission.
  • Added a 10-second ticker to retry finding the CSR until success or timeout.
  • Improved logging to indicate when the backend is actively "Searching" for the CSR.

Checklist

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.
  • My code follows the project's coding standards.

Additional Notes

This change does not impact the UI. It significantly improves backend API reliability for the "Quick Connect" feature.
Test Plan: Verified in a local environment with simulated agent startup delays.

@kubestellar-prow kubestellar-prow bot added the dco-signoff: no Indicates the PR's author has not signed the DCO. label Feb 1, 2026
@kubestellar-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onkar717 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request.

Before your PR can be merged, please ensure:

DCO Sign-off - All commits must be signed off with git commit -s to certify the Developer Certificate of Origin

PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), ⚠️ (breaking change)

Getting Started with KubeStellar:

Contributor Resources:


🌟 Help KubeStellar Grow - We Need Adopters!

Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes:

📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction!


A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack!

@github-actions github-actions bot added the backend Issues or PRs related to the low-level API machinery for KubeStellar label Feb 1, 2026
@kubestellar-prow kubestellar-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 1, 2026
@kubestellar-prow
Copy link

Hi @DhruvTotala. Thanks for your PR.

I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubestellar-prow kubestellar-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 1, 2026
Increased the CSR approval wait time from 30s to 5m in backend/api/handlers.go to support slower environments. Fixes kubestellar#2392.

Signed-off-by: dhruv <dhruvtotla30@gmail.com>
@kubestellar-prow kubestellar-prow bot added dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Feb 1, 2026
@oksaumya
Copy link
Member

oksaumya commented Feb 5, 2026

/ok-to-test

@kubestellar-prow kubestellar-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Issues or PRs related to the low-level API machinery for KubeStellar dco-signoff: yes Indicates the PR's author has signed the DCO. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Bug]: Import cluster through quick connect doesn't work

2 participants