cluster-api-provider-vsphere
cluster-api-provider-vsphere copied to clipboard
:sparkles: Allow using moid
What this PR does / why we need it: Allow users passing MOID as part of the spec
In some cases, passing the name of an object may not be enough. There may be disambiguation problems on name usage, or special characters that are accepted by vSphere but not properly encoded to be used during VM provisioning.
This change allows users that can rely on passing MOID (eg.: automation, terraform, vSphere UI) to pass the MOID of an object instead of passing the canonical name
Note: This change doesn't cover yet Network Name and the Failure Domain fields, that can be either covered by this same change, or on a follow up PR.
/test help
@chrischdi: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main/test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main/test pull-cluster-api-provider-vsphere-test-main/test pull-cluster-api-provider-vsphere-verify-main
The following commands are available to trigger optional jobs:
/test pull-cluster-api-provider-vsphere-apidiff-main
Use /test all to run the following jobs that were automatically triggered:
pull-cluster-api-provider-vsphere-apidiff-mainpull-cluster-api-provider-vsphere-test-mainpull-cluster-api-provider-vsphere-verify-main
In response to this:
/test help
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.
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/cc @lubronzhan
/retest
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
I will add the api docs as well, didn't finished taking care of all the comments yet :)
I will try to get to this PR soon, but currently trying to finish some work in CAPI first; in the meantime it will be great if we can add an E2E test to this PR.
e.g. we can take this E2E test, duplicate it, write code that resolve names in env vars into Moid, then sets env vars with the Moid so the test will use them
sorry folks, last 2 days were really busy. I will come back to this tomorrow as my first task :)
https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/pull/3235
will rebase over this one for the logging comments.
Then add some e2e tests as proposed by Fabrizio
@fabriziopandini just an update. Setting the e2e here is showing to be harder than I though, because in "theory" my e2e suite cannot access vcsim, which is running as a Pod on my cluster.
I am not sure we are expecting this to be possible or not, but in this case I will need to, instead of making my e2e test go to vcsim and get the MOIDs, make the vcsim envvar controller to add on its status the moid instead of the name.
wdyt? Which one should I follow?
~hum, weird this error, it passes locally. Will have to check the issue~
ra, running the file test errors, maybe I am using some global that is nullified after it, should check tomorrow
ok was able to fix e2e 🥳
Now just need to check the issue on unit test and we are good to go
/hold
I want to wait for https://github.com/vmware/govmomi/pull/3609 to be merged and a new release made, so instead we can bump govmomi here and rely on the new behavior of being able to search by name or moid directly from the library
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/hold cancel
This is validated on my tests, works fine :)
@sbueringer @fabriziopandini @chrischdi for final review :)
Thanks!
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main /test pull-cluster-api-provider-vsphere-e2e-vcsim-supervisor-main
Thank you very much!!
Feel free to merge once tests are green
/lgtm /approve /hold
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: sbueringer
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [sbueringer]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
All tests passing, removing hold
Thanks all /hold cancel