Repository navigation
🐛 Fixes creation kind cluster if missing before preload. - #553
Merged
pdettori merged 3 commits intoJan 29, 2026
Merged
Conversation
This catches the peculiar case where a local kind cluster does exist, but it is not kagenti. In other words, the context is set to an existing kind cluster, which short-circuits the first check for kind cluster because kubectl_api.rc does return 0. Signed-off-by: Gloire Rubambiza <[email protected]>
pdettori
reviewed
Jan 27, 2026
Signed-off-by: Gloire Rubambiza <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the Ansible installer would proceed with the wrong kind cluster when kubectl is already configured to access a non-kagenti kind cluster. The issue occurred because the original logic checked kubectl_api.rc != 0 to determine if cluster creation was needed, but this returns 0 (success) when connected to any cluster, including the wrong one.
Changes:
- Removed the
kubectl_api.rc != 0condition from the cluster setup block, ensuring the kagenti cluster is created and the context is verified whenevercreate_kind_cluster=true - Added context switching and verification logic to ensure kubectl points to the kagenti cluster
- Added cluster creation logic to the preload block to handle scenarios where
create_kind_cluster=falsebut preloading is enabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
@rubambiza thanks ! would it be ok for you to address copilot's comments ? |
Contributor
Author
|
@pdettori Yes, I plan to address them shortly. |
…oading. Signed-off-by: Gloire Rubambiza <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the bug where a local kind cluster does exist, but it is not kagenti.
In other words, the context is set to an existing kind cluster, which short-circuits the first check for kind cluster because
kubectl_api.rcdoes, in fact, return 0. The alternative was to force the user to create the cluster manually, but I wanted to make this frictionless such that thekagenticluster is automatically created for the user before preloading.Related issue(s)
Fixes #491