vsphere/internal/helper/computeresource/compute_resource_helper.go
func Reconfigure(obj BaseComputeResource, spec types.BaseComputeResourceConfigSpec) error {
	var c *object.ComputeResource
	switch t := obj.(type) {
	case *object.ComputeResource:
		log.Printf("[DEBUG] Reconfiguring standalone host %q", t.Name())
		c = t
	case *object.ClusterComputeResource:
		log.Printf("[DEBUG] Reconfiguring cluster %q", t.Name())
		c = &t.ComputeResource
	default:
		return fmt.Errorf("unsupported type for reconfigure: %T", t)
	}

	ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout)
	defer cancel()
	task, err := c.Reconfigure(ctx, spec, true)
	if err != nil {
		return err
	}
	return task.Wait(ctx)
}
func Reconfigure(obj BaseComputeResource, spec types.BaseComputeResourceConfigSpec) error {
	var c *object.ComputeResource
	switch t := obj.(type) {
	case *object.ComputeResource:
		log.Printf("[DEBUG] Reconfiguring standalone host %q", t.Name())
		c = t
	case *object.ClusterComputeResource:
		log.Printf("[DEBUG] Reconfiguring cluster %q", t.Name())
		c = &t.ComputeResource
	default:
		return fmt.Errorf("unsupported type for reconfigure: %T", t)
	}

	ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout)
	defer cancel()
	task, err := c.Reconfigure(ctx, spec, true)
	if err != nil {
		return err
	}
	return task.Wait(ctx)
}
func Reconfigure ( obj BaseComputeResource , spec types . BaseComputeResourceConfigSpec ) error { var c * object . ComputeResource switch t := obj . ( type ) { case * object . ComputeResource : log . Printf ( " " , t . Name ( ) ) c = t case * object . ClusterComputeResource : log . Printf ( " " , t . Name ( ) ) c = & t . ComputeResource default : return fmt . Errorf ( " " , t ) } ctx , cancel := context . WithTimeout ( context . Background ( ) , provider . DefaultAPITimeout ) defer cancel ( ) task , err := c . Reconfigure ( ctx , spec , true ) if err != nil { return err } return task . Wait ( ctx ) }
// Reconfigure reconfigures any BaseComputeResource that uses a
// BaseComputeResourceConfigSpec as configuration (example: standalone hosts,
// or clusters). Modify is always set.
Reconfigure reconfigures any BaseComputeResource that uses a BaseComputeResourceConfigSpec as configuration ( example : standalone hosts or clusters ) . Modify is always set .