Skip to content
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

Support adding an ESXi host as a source provider #697

Merged
merged 9 commits into from
Jan 9, 2024
Merged

Conversation

ahadas
Copy link
Member

@ahadas ahadas commented Jan 3, 2024

This PR adds the ability to add a vSphere provider that connects to SDK that is served by an ESXi host, instead of that of vCenter. This allows users to import directly from environments that comprise of ESXi hosts, without vCenter.

We don't add a new type of provider since most of the code is similar in both cases, the SDK that is exposed from ESXi aligns with the one exposed from vCenter. The only difference is that in case we operate with an ESXi host, we need to set the libvirt URL with esx:// rather than vpx:// for virt-v2v.

For vSphere providers that interact with an ESXi hosts, the backend doesn't assume clients specify the credentials for the host as these credentials were already specified for the provider - a mutating webhook copies the credentials from the secret of the Provider to the secret of the Host in this case.

@ahadas ahadas requested review from yaacov and liranr23 and removed request for liranr23 January 3, 2024 15:43
Copy link
Member

@liranr23 liranr23 left a comment

Choose a reason for hiding this comment

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

LGTM,
one question about the mutator/validation - does it make any sense to validate the given URLs of each provider to see it has /api? / /sdk?

@ahadas
Copy link
Member Author

ahadas commented Jan 7, 2024

LGTM, one question about the mutator/validation - does it make any sense to validate the given URLs of each provider to see it has /api? / /sdk?

we chose not to enforce it - the UI shows a warning in this case and lets the user to proceed with posting the provider

@ahadas ahadas requested a review from liranr23 January 7, 2024 22:01
@ahadas
Copy link
Member Author

ahadas commented Jan 8, 2024

For vSphere providers that interact with an ESXi hosts, the backend doesn't assume clients specify the credentials for the host as these credentials were already specified for the provider - a mutating webhook copies the credentials from the secret of the Provider to the secret of the Host in this case.

@yaacov that's what we agreed on offline, are you also ok with naming the new setting sdkEndpoint (that can be set to vcenter or esxi)?

@ahadas ahadas changed the title Support adding ESXi hosts as a source provider Support adding an ESXi host as a source provider Jan 8, 2024
@yaacov
Copy link
Member

yaacov commented Jan 9, 2024

@yaacov that's what we agreed on offline, are you also ok with naming the new setting sdkEndpoint (that can be set to vcenter or esxi)?

Ack, that is good for me too

Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Copy link

sonarcloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
No data about Coverage
2.0% Duplication on New Code

See analysis details on SonarCloud

@ahadas ahadas merged commit 2d4c331 into kubev2v:main Jan 9, 2024
10 checks passed
@ahadas ahadas deleted the esx branch January 9, 2024 21:35
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.

4 participants