Skip to content

feat: automatic cluster detection #1068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: automatic cluster detection #1068

wants to merge 9 commits into from

Conversation

razvan
Copy link
Member

@razvan razvan commented Jul 1, 2025

Description

Fixes stackabletech/issues#662

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

@razvan razvan self-assigned this Jul 1, 2025
@razvan razvan marked this pull request as ready for review July 1, 2025 15:25
@razvan razvan requested a review from a team July 1, 2025 15:26
@razvan razvan moved this to Development: Waiting for Review in Stackable Engineering Jul 1, 2025
@sbernauer sbernauer self-requested a review July 2, 2025 13:29
@sbernauer sbernauer moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Jul 2, 2025
@@ -651,7 +657,25 @@ pub async fn initialize_operator(
.context(InferKubeConfigSnafu)?;
let default_namespace = kubeconfig.default_namespace.clone();
let client = kube::Client::try_from(kubeconfig).context(CreateKubeClientSnafu)?;
let cluster_info = KubernetesClusterInfo::new(cluster_info_opts);

let local_cluster_info_opts = match cluster_info_opts.kubernetes_cluster_domain {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not further enlarge this already gigantic file.
Please have a look at KubernetesClusterInfo::new, I'd say there is the correct place to add this, even with a todo marker :)
You need to make KubernetesClusterInfo::new fallible for that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[snafu(display("failed to deserialize kubelet config JSON"))]
KubeletConfigJson { source: serde_json::Error },

#[snafu(display("empty Kubernetes nodes list"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain the user why we need at least one node to avoid user frustration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@sbernauer
Copy link
Member

That was a quick implementation, didn't expect that! :)

razvan and others added 3 commits July 2, 2025 15:56
@razvan razvan requested a review from sbernauer July 2, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Development: In Review
Development

Successfully merging this pull request may close these issues.

Automatic cluster domain detection
2 participants