nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: fluxcd/flagger
Pull request #1364 (2023-02-08 12:47:12)

use regex to match against headers in istio
Use regex filtering to match against session affinity cookie headers when using Istio instead of an exact match.

Fixes: #1339 
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>


Patch:
diff --git a/pkg/router/istio.go b/pkg/router/istio.go
index 7c78c6d9..5cf21e42 100644
--- a/pkg/router/istio.go
+++ b/pkg/router/istio.go
@@ -21,6 +21,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"math/rand"
+	"strings"
 	"time"
 
 	"github.com/google/go-cmp/cmp"
@@ -443,10 +444,11 @@ func (ir *IstioRouter) SetRoutes(
 				weightedRoute.Route[i] = routeDest
 			}
 
+			cookieKeyAndVal := strings.Split(canary.Status.SessionAffinityCookie, "=")
 			cookieMatch := istiov1alpha3.HTTPMatchRequest{
 				Headers: map[string]istiov1alpha1.StringMatch{
 					cookieHeader: {
-						Exact: canary.Status.SessionAffinityCookie,
+						Regex: fmt.Sprintf(".*%s.*%s.*", cookieKeyAndVal[0], cookieKeyAndVal[1]),
 					},
 				},
 			}
@@ -465,10 +467,11 @@ func (ir *IstioRouter) SetRoutes(
 
 			// Match against the previous session cookie and delete that cookie
 			if previousCookie != "" {
+				cookieKeyAndVal := strings.Split(previousCookie, "=")
 				cookieMatch := istiov1alpha3.HTTPMatchRequest{
 					Headers: map[string]istiov1alpha1.StringMatch{
 						cookieHeader: {
-							Exact: previousCookie,
+							Regex: fmt.Sprintf(".*%s.*%s.*", cookieKeyAndVal[0], cookieKeyAndVal[1]),
 						},
 					},
 				}


Test patch:
diff --git a/pkg/router/istio_test.go b/pkg/router/istio_test.go
index f2bb63f0..f74dc2f1 100644
--- a/pkg/router/istio_test.go
+++ b/pkg/router/istio_test.go
@@ -166,7 +166,7 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 		for _, match := range stickyRoute.Match {
 			if val, ok := match.Headers[cookieHeader]; ok {
 				found = true
-				assert.True(t, strings.HasPrefix(val.Exact, cookieKey))
+				assert.True(t, strings.Contains(val.Regex, cookieKey))
 				for _, routeDest := range stickyRoute.Route {
 					if routeDest.Destination.Host == pHost {
 						assert.Equal(t, 0, routeDest.Weight)
@@ -223,7 +223,7 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 		for _, match := range stickyRoute.Match {
 			if val, ok := match.Headers[cookieHeader]; ok {
 				found = true
-				assert.True(t, strings.HasPrefix(val.Exact, cookieKey))
+				assert.True(t, strings.Contains(val.Regex, cookieKey))
 				for _, routeDest := range stickyRoute.Route {
 					if routeDest.Destination.Host == pHost {
 						assert.Equal(t, 0, routeDest.Weight)
@@ -266,7 +266,7 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 		for _, match := range stickyRoute.Match {
 			if val, ok := match.Headers[cookieHeader]; ok {
 				found = true
-				assert.True(t, strings.HasPrefix(val.Exact, cookieKey))
+				assert.True(t, strings.Contains(val.Regex, cookieKey))
 				for _, routeDest := range stickyRoute.Route {
 					if routeDest.Destination.Host == pHost {
 						assert.Equal(t, 100, routeDest.Weight)
Repository: open-telemetry/opentelemetry-go
Pull request #176 (2019-10-09 05:10:18)

SDK: Multiple Unregister should not trigger multiple shutdown call
Closes https://github.com/open-telemetry/opentelemetry-go/issues/175


Patch:
diff --git a/sdk/trace/batch_span_processor.go b/sdk/trace/batch_span_processor.go
index cdc16578..2cafcb52 100644
--- a/sdk/trace/batch_span_processor.go
+++ b/sdk/trace/batch_span_processor.go
@@ -104,9 +104,9 @@ func NewBatchSpanProcessor(e export.SpanBatcher, opts ...BatchSpanProcessorOptio
 
 	//Start timer to export metrics
 	ticker := time.NewTicker(bsp.o.ScheduledDelayMillis)
+	bsp.stopWait.Add(1)
 	go func(ctx context.Context) {
 		defer ticker.Stop()
-		bsp.stopWait.Add(1)
 		for {
 			select {
 			case <-bsp.stopCh:
diff --git a/sdk/trace/span_processor.go b/sdk/trace/span_processor.go
index 3a594178..ceddf155 100644
--- a/sdk/trace/span_processor.go
+++ b/sdk/trace/span_processor.go
@@ -38,7 +38,7 @@ type SpanProcessor interface {
 	Shutdown()
 }
 
-type spanProcessorMap map[SpanProcessor]struct{}
+type spanProcessorMap map[SpanProcessor]*sync.Once
 
 var (
 	mu             sync.Mutex
@@ -56,7 +56,7 @@ func RegisterSpanProcessor(e SpanProcessor) {
 			new[k] = v
 		}
 	}
-	new[e] = struct{}{}
+	new[e] = &sync.Once{}
 	spanProcessors.Store(new)
 }
 
@@ -71,7 +71,11 @@ func UnregisterSpanProcessor(s SpanProcessor) {
 			new[k] = v
 		}
 	}
+	if stopOnce, ok := new[s]; ok && stopOnce != nil {
+		stopOnce.Do(func() {
+			s.Shutdown()
+		})
+	}
 	delete(new, s)
 	spanProcessors.Store(new)
-	s.Shutdown()
 }


Test patch:
diff --git a/sdk/trace/span_processor_test.go b/sdk/trace/span_processor_test.go
index 9bb81924..2f02c000 100644
--- a/sdk/trace/span_processor_test.go
+++ b/sdk/trace/span_processor_test.go
@@ -117,7 +117,7 @@ func TestSpanProcessorShutdown(t *testing.T) {
 		t.Fatalf("Error creating new instance of TestSpanProcessor\n")
 	}
 
-	wantCount := sp.shutdownCount + 1
+	wantCount := 1
 	sp.Shutdown()
 
 	gotCount := sp.shutdownCount
@@ -127,13 +127,13 @@ func TestSpanProcessorShutdown(t *testing.T) {
 }
 
 func TestMultipleUnregisterSpanProcessorCalls(t *testing.T) {
-	name := "Increment shutdown counter after each UnregisterSpanProcessor call"
+	name := "Increment shutdown counter after first UnregisterSpanProcessor call"
 	sp := NewTestSpanProcessor()
 	if sp == nil {
 		t.Fatalf("Error creating new instance of TestSpanProcessor\n")
 	}
 
-	wantCount := sp.shutdownCount + 1
+	wantCount := 1
 
 	sdktrace.RegisterSpanProcessor(sp)
 	sdktrace.UnregisterSpanProcessor(sp)
@@ -143,8 +143,7 @@ func TestMultipleUnregisterSpanProcessorCalls(t *testing.T) {
 		t.Errorf("%s: wrong counter: got %d, want %d\n", name, gotCount, wantCount)
 	}
 
-	// Multiple UnregisterSpanProcessor triggers multiple Shutdown calls.
-	wantCount = wantCount + 1
+	// Multiple UnregisterSpanProcessor should not trigger multiple Shutdown calls.
 	sdktrace.UnregisterSpanProcessor(sp)
 
 	gotCount = sp.shutdownCount
Repository: vmware/govmomi
Pull request #2427 (2021-05-07 22:40:49)

vcsim: avoid edit device panic when DeviceInfo is nil


Patch:
diff --git a/simulator/virtual_machine.go b/simulator/virtual_machine.go
index b05fa4c9..098b9d97 100644
--- a/simulator/virtual_machine.go
+++ b/simulator/virtual_machine.go
@@ -1382,7 +1382,9 @@ func (vm *VirtualMachine) configureDevices(ctx *Context, spec *types.VirtualMach
 				return invalid
 			}
 			devices = vm.removeDevice(ctx, devices, &rspec)
-			device.DeviceInfo.GetDescription().Summary = "" // regenerate summary
+			if device.DeviceInfo != nil {
+				device.DeviceInfo.GetDescription().Summary = "" // regenerate summary
+			}
 
 			err := vm.configureDevice(ctx, devices, dspec)
 			if err != nil {


Test patch:
diff --git a/simulator/virtual_machine_test.go b/simulator/virtual_machine_test.go
index 2055c912..1f7b4cb4 100644
--- a/simulator/virtual_machine_test.go
+++ b/simulator/virtual_machine_test.go
@@ -374,6 +374,11 @@ func TestReconfigVmDevice(t *testing.T) {
 			t.Error(err)
 		}
 
+		d.GetVirtualDevice().DeviceInfo = nil
+		if err = vm.EditDevice(ctx, d); err != nil {
+			t.Error(err)
+		}
+
 		// RemoveDevice and delete the file backing
 		if err = vm.RemoveDevice(ctx, false, d); err != nil {
 			t.Error(err)
Repository: vmware/govmomi
Pull request #2526 (2021-07-29 23:33:58)

vcsim: use 'domain-c' prefix for cluster moids
## Description

Real vCenter uses a `domain-c` prefix, rather than just `domain-`

## Type of change

Please mark options that are relevant:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Adjusted test in object.bats

## Checklist:

- [x] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/simulator/registry.go b/simulator/registry.go
index 207a3c49..dd03b7a5 100644
--- a/simulator/registry.go
+++ b/simulator/registry.go
@@ -45,8 +45,9 @@ var refValueMap = map[string]string{
 	"VirtualMachineSnapshot":         "snapshot",
 	"VmwareDistributedVirtualSwitch": "dvs",
 	"DistributedVirtualSwitch":       "dvs",
-	"ClusterComputeResource":         "domain",
+	"ClusterComputeResource":         "domain-c",
 	"Folder":                         "group",
+	"StoragePod":                     "group-p",
 }
 
 // Map is the default Registry instance.
@@ -113,11 +114,16 @@ func typeName(item mo.Reference) string {
 
 // valuePrefix returns the value name prefix of a given object
 func valuePrefix(typeName string) string {
-	if v, ok := refValueMap[typeName]; ok {
-		return v
+	v, ok := refValueMap[typeName]
+	if ok {
+		if strings.Contains(v, "-") {
+			return v
+		}
+	} else {
+		v = strings.ToLower(typeName)
 	}
 
-	return strings.ToLower(typeName)
+	return v + "-"
 }
 
 // newReference returns a new MOR, where Type defaults to type of the given item
@@ -131,7 +137,7 @@ func (r *Registry) newReference(item mo.Reference) types.ManagedObjectReference
 
 	if ref.Value == "" {
 		n := atomic.AddInt64(&r.counter, 1)
-		ref.Value = fmt.Sprintf("%s-%d", valuePrefix(ref.Type), n)
+		ref.Value = fmt.Sprintf("%s%d", valuePrefix(ref.Type), n)
 	}
 
 	return ref


Test patch:
diff --git a/govc/test/object.bats b/govc/test/object.bats
index cf15e8f0..3539c765 100755
--- a/govc/test/object.bats
+++ b/govc/test/object.bats
@@ -573,7 +573,7 @@ EOF
 
   run govc find -l -i /
   assert_success
-  assert_matches :domain- # ClusterComputeResource moid value
+  assert_matches :domain-c # ClusterComputeResource moid value
   assert_matches :group- # Folder moid value
   assert_matches :resgroup- # ResourcePool moid value
   assert_matches :dvs- # DistributedVirtualSwitch moid value
Repository: vmware/govmomi
Pull request #2569 (2021-09-02 13:41:42)

fix: generate negative device key
## Description

Fix `VirtualDeviceList#CreateEthernetCard()` to always generate negative device keys so that they will not collide with existing keys.

Closes: #2536

## Type of change

Please mark options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.

- ensure all device have negative device keys in CreateEthernetCard unittest

**Test Configuration**:
* Toolchain:
* SDK:
* (add more if needed)

## Checklist:

- [x] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/object/virtual_device_list.go b/object/virtual_device_list.go
index f25f6f2c..c45f553a 100644
--- a/object/virtual_device_list.go
+++ b/object/virtual_device_list.go
@@ -68,7 +68,13 @@ func EthernetCardTypes() VirtualDeviceList {
 		&types.VirtualSriovEthernetCard{},
 	}).Select(func(device types.BaseVirtualDevice) bool {
 		c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard()
-		c.GetVirtualDevice().Key = int32(rand.Uint32()) * -1
+
+		key := rand.Int31() * -1
+		if key == 0 {
+			key = -1
+		}
+
+		c.GetVirtualDevice().Key = key
 		return true
 	})
 }


Test patch:
diff --git a/object/virtual_device_list_test.go b/object/virtual_device_list_test.go
index cf2fc47c..a50867f0 100644
--- a/object/virtual_device_list_test.go
+++ b/object/virtual_device_list_test.go
@@ -688,10 +688,14 @@ func TestCreateEthernetCard(t *testing.T) {
 	}
 
 	for _, name := range []string{"", "e1000", "e1000e", "vmxnet2", "vmxnet3", "pcnet32", "sriov"} {
-		_, err := EthernetCardTypes().CreateEthernetCard(name, nil)
+		c, err := EthernetCardTypes().CreateEthernetCard(name, nil)
 		if err != nil {
 			t.Error(err)
 		}
+
+		if key := c.GetVirtualDevice().Key; key >= 0 {
+			t.Errorf("device key %d should be negative", key)
+		}
 	}
 }
Repository: vmware/govmomi
Pull request #2621 (2021-10-13 22:32:24)

Implement mo.Reference interface in task+event managers
## Description

Prior to #2535 both managers implemented mo.Reference via the embedded 'object.Common' field,
but that field was removed.

## Type of change

Please mark options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update
- [ ] Build related change

## Checklist:

- [x] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/event/manager.go b/event/manager.go
index 45698a8d..c423c183 100644
--- a/event/manager.go
+++ b/event/manager.go
@@ -50,6 +50,11 @@ func NewManager(c *vim25.Client) *Manager {
 	return &m
 }
 
+// Reference returns the event.Manager MOID
+func (m Manager) Reference() types.ManagedObjectReference {
+	return m.r
+}
+
 func (m Manager) Client() *vim25.Client {
 	return m.c
 }
diff --git a/task/manager.go b/task/manager.go
index 633085ab..1fbf9ead 100644
--- a/task/manager.go
+++ b/task/manager.go
@@ -23,6 +23,11 @@ func NewManager(c *vim25.Client) *Manager {
 	return &m
 }
 
+// Reference returns the task.Manager MOID
+func (m Manager) Reference() types.ManagedObjectReference {
+	return m.r
+}
+
 // CreateCollectorForTasks returns a task history collector, a specialized
 // history collector that gathers TaskInfo data objects.
 func (m Manager) CreateCollectorForTasks(ctx context.Context, filter types.TaskFilterSpec) (*HistoryCollector, error) {


Test patch:
diff --git a/event/example_test.go b/event/example_test.go
index 0660b8f7..bd521e83 100644
--- a/event/example_test.go
+++ b/event/example_test.go
@@ -24,9 +24,13 @@ import (
 	"github.com/vmware/govmomi/find"
 	"github.com/vmware/govmomi/simulator"
 	"github.com/vmware/govmomi/vim25"
+	"github.com/vmware/govmomi/vim25/mo"
 	"github.com/vmware/govmomi/vim25/types"
 )
 
+// ensure event.Manager implements the mo.Reference interface
+var _ mo.Reference = new(event.Manager)
+
 func ExampleManager_Events() {
 	simulator.Run(func(ctx context.Context, c *vim25.Client) error {
 		m := event.NewManager(c)
diff --git a/task/wait_test.go b/task/wait_test.go
index 8ebd5b0a..d3b24ff4 100644
--- a/task/wait_test.go
+++ b/task/wait_test.go
@@ -19,9 +19,13 @@ package task
 import (
 	"testing"
 
+	"github.com/vmware/govmomi/vim25/mo"
 	"github.com/vmware/govmomi/vim25/types"
 )
 
+// ensure task.Manager implements the mo.Reference interface
+var _ mo.Reference = new(Manager)
+
 func TestCallbackFn(t *testing.T) {
 	cb := &taskCallback{}
Repository: vmware/govmomi
Pull request #2684 (2021-12-10 16:13:07)

govc: Require full or absolute paths
## Description

When using the object name instead of absolute/relative paths, e.g. in `govc field.set`, the finder could return duplicate objects. This change errors out if the specified (object) path is not absolute/relative.

Closes: 2561
Signed-off-by: Michael Gasch <mgasch@vmware.com>

## Type of change

Please mark options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update
- [ ] Build related change

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.

- [x] Added `govc fields.set` test

## Checklist:

- [ ] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/govc/flags/datacenter.go b/govc/flags/datacenter.go
index 3f2343c3..d73f36a8 100644
--- a/govc/flags/datacenter.go
+++ b/govc/flags/datacenter.go
@@ -203,6 +203,10 @@ func (flag *DatacenterFlag) ManagedObjects(ctx context.Context, args []string) (
 			continue
 		}
 
+		if !strings.Contains(arg, "/") {
+			return nil, fmt.Errorf("%q must be qualified with a path", arg)
+		}
+
 		elements, err := finder.ManagedObjectList(ctx, arg)
 		if err != nil {
 			return nil, err


Test patch:
diff --git a/govc/test/fields.bats b/govc/test/fields.bats
index ba48a66f..0395b33f 100755
--- a/govc/test/fields.bats
+++ b/govc/test/fields.bats
@@ -25,6 +25,10 @@ load test_helper
   key=$(govc fields.ls | grep $field | awk '{print $1}')
 
   val="foo"
+
+  run govc fields.set $field $val $vm_id
+  assert_failure
+
   run govc fields.set $field $val vm/$vm_id
   assert_success
Repository: vmware/govmomi
Pull request #2732 (2022-02-02 00:24:14)

fix: support govc import.spec for remote ova
## Description

PR #1885 added support for remote ovf files, but not ova.

Closes: #1836

## Type of change

Please mark options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update
- [ ] Build related change

## Checklist:

- [x] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/govc/importx/spec.go b/govc/importx/spec.go
index 514f338c..e425fe62 100644
--- a/govc/importx/spec.go
+++ b/govc/importx/spec.go
@@ -107,7 +107,7 @@ func (cmd *spec) Run(ctx context.Context, f *flag.FlagSet) error {
 			return fmt.Errorf("invalid file extension %s", path.Ext(fpath))
 		}
 
-		if isRemotePath(fpath) {
+		if isRemotePath(f.Arg(0)) {
 			client, err := cmd.Client()
 			if err != nil {
 				return err


Test patch:
diff --git a/govc/test/import.bats b/govc/test/import.bats
index 3d714614..7550fad8 100755
--- a/govc/test/import.bats
+++ b/govc/test/import.bats
@@ -22,6 +22,9 @@ load test_helper
   run govc import.spec "https://$(govc env GOVC_URL)/folder/$TTYLINUX_NAME.ovf"
   assert_success
 
+  run govc import.spec "https://$(govc env GOVC_URL)/folder/$TTYLINUX_NAME.ova"
+  assert_success
+
   proto=$(jq -r .IPProtocol <<<"$output")
   assert_equal IPv4 "$proto"
Repository: vmware/govmomi
Pull request #2755 (2022-02-14 21:23:29)

vcsim: set summary.guest.{hostName,ipAddress} in CustomizeVM
## Description

set summary.guest.{hostName,ipAddress} in CustomizeVM

Closes: #2753

## Type of change

Please mark options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to
  not work as expected)
- [ ] This change requires a documentation update
- [ ] Build related change

## Checklist:

- [x] My code follows the CONTRIBUTION [guidelines](./../CONTRIBUTING.md) of
  this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged


Patch:
diff --git a/simulator/virtual_machine.go b/simulator/virtual_machine.go
index 158ded82..3483f8ba 100644
--- a/simulator/virtual_machine.go
+++ b/simulator/virtual_machine.go
@@ -2029,9 +2029,11 @@ func (vm *VirtualMachine) customize(ctx *Context) {
 	}
 	if hostname != "" {
 		changes = append(changes, types.PropertyChange{Name: "guest.hostName", Val: hostname})
+		changes = append(changes, types.PropertyChange{Name: "summary.guest.hostName", Val: hostname})
 	}
 	if address != "" {
 		changes = append(changes, types.PropertyChange{Name: "guest.ipAddress", Val: address})
+		changes = append(changes, types.PropertyChange{Name: "summary.guest.ipAddress", Val: address})
 	}
 
 	vm.imc = nil


Test patch:
diff --git a/govc/test/vm.bats b/govc/test/vm.bats
index d16cfe67..7b2fb77b 100755
--- a/govc/test/vm.bats
+++ b/govc/test/vm.bats
@@ -1116,6 +1116,16 @@ load test_helper
   run govc object.collect -s vm/DC0_H0_VM0 guest.ipAddress
   assert_success 10.0.0.43
 
+  run govc object.collect -s vm/DC0_H0_VM0 summary.guest.ipAddress
+  assert_success 10.0.0.43
+
+  run govc object.collect -s vm/DC0_H0_VM0 summary.guest.hostName
+  assert_success windoze
+
+  run govc vm.info DC0_H0_VM0
+  assert_success
+  assert_matches 10.0.0.43
+
   run govc object.collect -s vm/DC0_H0_VM0 guest.hostName
   assert_success windoze