Skip to content

Conversation

@onuryilmaz
Copy link
Contributor

@onuryilmaz onuryilmaz commented Aug 19, 2025

Description

After an initial reconcile error (e.g., Secret not found), the ClusterKubeconfig keeps status.conditions[type=ReconcileFailed]=True even after the Secret is created and the cluster becomes ready.
Root cause: calculateKubeconfigStatus derives readiness only from the previous status; if ReconcileFailed is already True, it forces Ready=False and never clears the failure. It does not re-evaluate the current Spec to see that kubeconfig data is now present.

Fix:
Make calculateKubeconfigStatus inspect the current spec (Clusters, AuthInfo, Contexts + CurrentContext). If these are populated, set:

  • KubeconfigReady=True (reason=Complete)
  • ReconcileFailed=False (reason=ReadyState)
  • (optionally) KubeconfigCreated=False (reason=ReadyState)

This clears the stale failure and reflects the actual, now-healthy state.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@onuryilmaz onuryilmaz requested a review from a team as a code owner August 19, 2025 16:32
@onuryilmaz onuryilmaz changed the title fix(kubeconfigs): calculate kubeconfig status fix(clusterkubeconfigs): calculate kubeconfig status Aug 19, 2025
@onuryilmaz onuryilmaz requested a review from IvoGoman September 29, 2025 20:53
@onuryilmaz onuryilmaz merged commit e4f240e into main Oct 5, 2025
27 checks passed
@onuryilmaz onuryilmaz deleted the fix/clusterkubeconfigs-status branch October 5, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [BUG] - ClusterKubeConfig not Ready for Clusters connected via OIDC

3 participants