File tree Expand file tree Collapse file tree 2 files changed +4
-33
lines changed Expand file tree Collapse file tree 2 files changed +4
-33
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,18 @@ limitations under the License.
17
17
package govmomi
18
18
19
19
import (
20
+ "github.com/pkg/errors"
20
21
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
21
22
22
23
"sigs.k8s.io/cluster-api-provider-vsphere/pkg/context"
23
- "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/govmomi/esxi"
24
24
"sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/govmomi/vcenter"
25
25
)
26
26
27
27
// createVM creates a new VM with the data in the VMContext passed. This method does not wait
28
28
// for the new VM to be created.
29
29
func createVM (ctx * context.VMContext , bootstrapData []byte , format bootstrapv1.Format ) error {
30
- if ctx .Session .IsVC () {
31
- return vcenter . Clone ( ctx , bootstrapData , format )
30
+ if ! ctx .Session .IsVC () {
31
+ return errors . Errorf ( "expected VCenter client got %v" , ctx . Session . ServiceContent . About . ApiType )
32
32
}
33
- return esxi .Clone (ctx , bootstrapData , format )
33
+ return vcenter .Clone (ctx , bootstrapData , format )
34
34
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments