Skip to content

Commit

Permalink
Merge pull request #48 from Microsoft/PendingUpdates
Browse files Browse the repository at this point in the history
Fixed PendingUpdates call with correct query
  • Loading branch information
darstahl committed Jun 9, 2016
2 parents 5f88b2e + c4d043d commit 59dba39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var (
ErrTimeout = errors.New("hcsshim: timeout waiting for notification")
)

const pendingUpdatesQuery = `{ "PropertyTypes" : ["PendingUpdates"]}`

type ContainerError struct {
Container *container
Operation string
Expand Down Expand Up @@ -273,12 +275,12 @@ func (container *container) hcsWait(timeout uint32) (bool, error) {
return waitForSingleObject(exitEvent, timeout)
}

func (container *container) properties() (*containerProperties, error) {
func (container *container) properties(query string) (*containerProperties, error) {
var (
resultp *uint16
propertiesp *uint16
)
err := hcsGetComputeSystemProperties(container.handle, "", &propertiesp, &resultp)
err := hcsGetComputeSystemProperties(container.handle, query, &propertiesp, &resultp)
err = processHcsResult(err, resultp)
if err != nil {
return nil, err
Expand All @@ -302,7 +304,7 @@ func (container *container) HasPendingUpdates() (bool, error) {
operation := "HasPendingUpdates"
title := "HCSShim::Container::" + operation
logrus.Debugf(title+" id=%s", container.id)
properties, err := container.properties()
properties, err := container.properties(pendingUpdatesQuery)
if err != nil {
err := &ContainerError{Container: container, Operation: operation, Err: err}
logrus.Error(err)
Expand Down

0 comments on commit 59dba39

Please sign in to comment.