Skip to content

chore: Removes unused in-tree csi logic#2005

Open
appiepollo14 wants to merge 1 commit intokubermatic:mainfrom
appiepollo14:chore/remove-intree-outoftreecheck
Open

chore: Removes unused in-tree csi logic#2005
appiepollo14 wants to merge 1 commit intokubermatic:mainfrom
appiepollo14:chore/remove-intree-outoftreecheck

Conversation

@appiepollo14
Copy link
Copy Markdown

What this PR does / why we need it:
Removes unused IntreeCloudProviderImplementationSupported func
The logic has no use as all CSI providers are out-of-tree.

Which issue(s) this PR fixes:

Fixes #1984

What type of PR is this?

/kind cleanup
/kind chore

Special notes for your reviewer:

Does this PR introduce a user-facing change? Then add your Release Note here:

NONE

Documentation:

NONE

Removes unused `IntreeCloudProviderImplementationSupported` func

Signed-off-by: appiepollo14 <asjer94@live.com>
Copilot AI review requested due to automatic review settings March 23, 2026 20:09
@kubermatic-bot kubermatic-bot added release-note-none Denotes a PR that doesn't merit a release note. docs/none Denotes a PR that doesn't need documentation (changes). kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. kind/chore Updating grunt tasks etc; no production code changes. labels Mar 23, 2026
@kubermatic-bot
Copy link
Copy Markdown
Contributor

[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 julioc-p 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

@kubermatic-bot kubermatic-bot added sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 23, 2026
@kubermatic-bot
Copy link
Copy Markdown
Contributor

Hi @appiepollo14. Thanks for your PR.

I'm waiting for a kubermatic 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.

@kubermatic-bot kubermatic-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 23, 2026
@appiepollo14
Copy link
Copy Markdown
Author

/cc @kron4eg

@kubermatic-bot kubermatic-bot requested a review from kron4eg March 23, 2026 20:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the now-unused in-tree cloud provider support helper and simplifies ProviderID-setting logic in the machine controller based on the assumption that cloud providers run out-of-tree.

Changes:

  • Removed providerconfig.IntreeCloudProviderImplementationSupported from the SDK.
  • Simplified ProviderID assignment logic in the machine reconciler to only depend on ExternalCloudProvider.
  • Minor comment cleanup in the machine controller.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
sdk/providerconfig/types.go Deletes the exported in-tree support helper from the SDK module.
pkg/controller/machine/controller.go Removes in-tree gating around ProviderID updates and tweaks related comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -117,13 +117,6 @@ var (
}
)

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

This removes an exported symbol (IntreeCloudProviderImplementationSupported) from the k8c.io/machine-controller/sdk module. That is a breaking API change for downstream consumers importing sdk/providerconfig; consider keeping it with a deprecation comment (or providing a replacement) until a major-version bump / communicated removal.

Suggested change
// IntreeCloudProviderImplementationSupported indicates whether in-tree cloud provider implementations are supported.
//
// Deprecated: This symbol is kept for backward compatibility and will be removed in a future major version.
var IntreeCloudProviderImplementationSupported = true

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@appiepollo14 I'm sure replacing a function with a variable is not a kind of non-breaking change copilot is talking about, but something like will be good

// IntreeCloudProviderImplementationSupported is deprecated and constantly returns false
func IntreeCloudProviderImplementationSupported(CloudProvider) bool {
	return false
}

Comment on lines +458 to 462
// case 3.2: if the node exists and external CCM is not available. Then set the provider-id for the node.
if !r.nodeSettings.ExternalCloudProvider && node.Spec.ProviderID == "" {
providerID := fmt.Sprintf(ProviderIDPattern, providerConfig.CloudProvider, machine.UID)
if err := r.updateNode(ctx, node, func(n *corev1.Node) {
n.Spec.ProviderID = providerID
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

ExternalCloudProvider is documented as controlling the kubelet --cloud-provider=external flag. When it's false, an in-tree cloud provider/CCM may still be in use and set a cloud-specific node.spec.providerID. With the inTree gate removed, this code can now write the synthetic kubermatic://... ProviderID for providers like Azure/vSphere/GCE and potentially prevent the in-tree CCM from ever setting the correct ProviderID format, breaking cloud integrations. Consider restoring a guard for in-tree modes/providers, or otherwise ensuring in-tree mode cannot be enabled anymore (e.g. by enforcing ExternalCloudProvider=true where appropriate).

Copilot uses AI. Check for mistakes.
Comment on lines +900 to +901
// If both external CCM is not available. We set provider-id for the machine explicitly.
if !r.nodeSettings.ExternalCloudProvider {
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Same concern as above: when ExternalCloudProvider is false (in-tree kubelet mode), this now sets machine.spec.providerID to the synthetic kubermatic://... value for all providers. If an in-tree cloud provider/CCM is expected to set a cloud-specific providerID, writing a synthetic value here can block later reconciliation from ever using the canonical providerID format.

Suggested change
// If both external CCM is not available. We set provider-id for the machine explicitly.
if !r.nodeSettings.ExternalCloudProvider {
// If an external cloud provider/CCM is used, set a synthetic providerID for the machine explicitly.
if r.nodeSettings.ExternalCloudProvider {

Copilot uses AI. Check for mistakes.
}

// clearMachineError is a convenience function to remove a error on the machine if its set.
// clearMachineError is a convenience function to remove an error on the machine if its set.
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Comment grammar: "if its set" should be "if it's set".

Suggested change
// clearMachineError is a convenience function to remove an error on the machine if its set.
// clearMachineError is a convenience function to remove an error on the machine if it's set.

Copilot uses AI. Check for mistakes.
Comment on lines +458 to 462
// case 3.2: if the node exists and external CCM is not available. Then set the provider-id for the node.
if !r.nodeSettings.ExternalCloudProvider && node.Spec.ProviderID == "" {
providerID := fmt.Sprintf(ProviderIDPattern, providerConfig.CloudProvider, machine.UID)
if err := r.updateNode(ctx, node, func(n *corev1.Node) {
n.Spec.ProviderID = providerID
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Behavior around ProviderID assignment changed significantly here, but there are existing controller unit tests in this package. It would be good to add/adjust tests covering when node.spec.providerID / machine.spec.providerID should (and should not) be set based on ExternalCloudProvider and cloud provider, to prevent regressions for in-tree vs out-of-tree CCM scenarios.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/chore Updating grunt tasks etc; no production code changes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

question: Vsphere intree vs out-of-tree

4 participants