|
|
@ -72,14 +72,14 @@ func (s *Server) Write(ctx context.Context, req *pbresource.WriteRequest) (*pbre
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err = reg.Validate(req.Resource); err != nil {
|
|
|
|
|
|
|
|
return nil, status.Error(codes.InvalidArgument, err.Error())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = reg.Mutate(req.Resource); err != nil {
|
|
|
|
if err = reg.Mutate(req.Resource); err != nil {
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed mutate hook: %v", err.Error())
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed mutate hook: %v", err.Error())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = reg.Validate(req.Resource); err != nil {
|
|
|
|
|
|
|
|
return nil, status.Error(codes.InvalidArgument, err.Error())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// At the storage backend layer, all writes are CAS operations.
|
|
|
|
// At the storage backend layer, all writes are CAS operations.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This makes it possible to *safely* do things like keeping the Uid stable
|
|
|
|
// This makes it possible to *safely* do things like keeping the Uid stable
|
|
|
|