2018-09-05 14:54:38 -04:00
|
|
|
package wclayer
|
2018-03-19 18:57:30 -04:00
|
|
|
|
2018-09-05 14:54:38 -04:00
|
|
|
import (
|
|
|
|
"github.com/Microsoft/hcsshim/internal/hcserror"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/interop"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
2018-03-19 18:57:30 -04:00
|
|
|
|
|
|
|
// GetSharedBaseImages will enumerate the images stored in the common central
|
|
|
|
// image store and return descriptive info about those images for the purpose
|
|
|
|
// of registering them with the graphdriver, graph, and tagstore.
|
|
|
|
func GetSharedBaseImages() (imageData string, err error) {
|
|
|
|
title := "hcsshim::GetSharedBaseImages "
|
|
|
|
|
|
|
|
logrus.Debugf("Calling proc")
|
|
|
|
var buffer *uint16
|
|
|
|
err = getBaseImages(&buffer)
|
|
|
|
if err != nil {
|
2018-09-05 14:54:38 -04:00
|
|
|
err = hcserror.New(err, title, "")
|
2018-03-19 18:57:30 -04:00
|
|
|
logrus.Error(err)
|
|
|
|
return
|
|
|
|
}
|
2018-09-05 14:54:38 -04:00
|
|
|
imageData = interop.ConvertAndFreeCoTaskMemString(buffer)
|
2018-03-19 18:57:30 -04:00
|
|
|
logrus.Debugf(title+" - succeeded output=%s", imageData)
|
|
|
|
return
|
|
|
|
}
|