add warning for empty attributes

This commit is contained in:
Chris Lu 2018-12-02 22:57:59 -08:00
parent d3be8e022f
commit bea162c34c

View file

@ -113,6 +113,10 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr
fs.filer.DeleteChunks(garbages)
if req.Entry.Attributes == nil {
return nil, fmt.Errorf("can not create entry with empty attributes")
}
err = fs.filer.CreateEntry(&filer2.Entry{
FullPath: fullpath,
Attr: filer2.PbToEntryAttribute(req.Entry.Attributes),