boskos/mason/client.go
func (c *Client) ReleaseOne(name, dest string) (allErrors error) {
	res, err := c.getResource(name)
	if err != nil {
		allErrors = err
		return
	}
	resourceNames := []string{name}
	var leasedResources common.LeasedResources
	if err := res.UserData.Extract(LeasedResources, &leasedResources); err != nil {
		if _, ok := err.(*common.UserDataNotFound); !ok {
			logrus.WithError(err).Errorf("cannot parse %s from User Data", LeasedResources)
			allErrors = multierror.Append(allErrors, err)
			if err := c.basic.ReleaseOne(name, dest); err != nil {
				logrus.WithError(err).Warningf("failed to release resource %s", name)
				allErrors = multierror.Append(allErrors, err)
			}
			return
		}
	}
	resourceNames = append(resourceNames, leasedResources...)
	for _, n := range resourceNames {
		if err := c.basic.ReleaseOne(n, dest); err != nil {
			logrus.WithError(err).Warningf("failed to release resource %s", n)
			allErrors = multierror.Append(allErrors, err)
		}
	}
	c.deleteResource(name)
	return
}
func (c *Client) ReleaseOne(name, dest string) (allErrors error) {
	res, err := c.getResource(name)
	if err != nil {
		allErrors = err
		return
	}
	resourceNames := []string{name}
	var leasedResources common.LeasedResources
	if err := res.UserData.Extract(LeasedResources, &leasedResources); err != nil {
		if _, ok := err.(*common.UserDataNotFound); !ok {
			logrus.WithError(err).Errorf("cannot parse %s from User Data", LeasedResources)
			allErrors = multierror.Append(allErrors, err)
			if err := c.basic.ReleaseOne(name, dest); err != nil {
				logrus.WithError(err).Warningf("failed to release resource %s", name)
				allErrors = multierror.Append(allErrors, err)
			}
			return
		}
	}
	resourceNames = append(resourceNames, leasedResources...)
	for _, n := range resourceNames {
		if err := c.basic.ReleaseOne(n, dest); err != nil {
			logrus.WithError(err).Warningf("failed to release resource %s", n)
			allErrors = multierror.Append(allErrors, err)
		}
	}
	c.deleteResource(name)
	return
}
// ReleaseOne will release a resource as well as leased resources associated to it