2015-07-18 20:15:02 -04:00
|
|
|
package hcsshim
|
|
|
|
|
2016-02-01 18:09:35 -05:00
|
|
|
import "github.com/Sirupsen/logrus"
|
2015-07-18 20:15:02 -04:00
|
|
|
|
2015-08-27 18:46:00 -04:00
|
|
|
// NameToGuid converts the given string into a GUID using the algorithm in the
|
|
|
|
// Host Compute Service, ensuring GUIDs generated with the same string are common
|
|
|
|
// across all clients.
|
2015-07-18 20:15:02 -04:00
|
|
|
func NameToGuid(name string) (id GUID, err error) {
|
|
|
|
title := "hcsshim::NameToGuid "
|
|
|
|
logrus.Debugf(title+"Name %s", name)
|
|
|
|
|
2016-02-01 18:09:35 -05:00
|
|
|
err = nameToGuid(name, &id)
|
2015-07-18 20:15:02 -04:00
|
|
|
if err != nil {
|
2016-02-01 18:09:35 -05:00
|
|
|
err = makeErrorf(err, title, "name=%s", name)
|
2015-07-18 20:15:02 -04:00
|
|
|
logrus.Error(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|