func (m *mockFilesystemAccessor) provisionFilesystem(tag names.FilesystemTag) params.Filesystem { f := params.Filesystem{ FilesystemTag: tag.String(), Info: params.FilesystemInfo{ FilesystemId: "vol-" + tag.Id(), }, } m.provisionedFilesystems[tag.String()] = f return f }
func (s *tmpfsFilesystemSource) readFilesystemInfo(tag names.FilesystemTag) (storage.FilesystemInfo, error) { var info filesystemInfo if err := utils.ReadYaml(s.filesystemInfoFile(tag), &info); err != nil { return storage.FilesystemInfo{}, errors.Annotate(err, "reading filesystem info from disk") } if info.Size == nil { return storage.FilesystemInfo{}, errors.New("invalid filesystem info: missing size") } return storage.FilesystemInfo{ FilesystemId: tag.String(), Size: *info.Size, }, nil }