示例#1
0
func (boot bootstrap) checkLastMountedCid(settings boshsettings.Settings) error {
	lastMountedCid, err := boot.lastMountedCid()
	if err != nil {
		return bosherr.WrapError(err, "Fetching last mounted disk CID")
	}

	if len(settings.Disks.Persistent) == 0 || lastMountedCid == "" {
		return nil
	}

	if _, ok := settings.PersistentDiskSettings(lastMountedCid); !ok {
		return fmt.Errorf("Attached disk disagrees with previous mount")
	}

	return nil
}