Skip to content

Commit

Permalink
Minor Code Fixes (#1361)
Browse files Browse the repository at this point in the history
* fix panic if model is registered without name

* fix key variable shadowed
  • Loading branch information
matus-mrekaj authored and ondrej-fabry committed May 29, 2019
1 parent 37867b1 commit 19b0af2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/models/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func getItemID(pb proto.Message) (*api.Item_ID, error) {
return nil, fmt.Errorf("message %s is not registered as model", protoName)
}

name, err := model.nameFunc(pb)
name, err := model.name(pb)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/orchestrator/genericmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *genericManagerSvc) SetConfig(ctx context.Context, req *api.SetConfigReq
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
key := model.KeyPrefix() + item.Id.Name
key = model.KeyPrefix() + item.Id.Name
ops[key] = api.UpdateResult_DELETE
} else {
return nil, status.Error(codes.InvalidArgument, "ProtoItem has no key or val defined.")
Expand Down

0 comments on commit 19b0af2

Please sign in to comment.