Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: Fix Update Operation #202

Merged
merged 2 commits into from
Jul 27, 2021
Merged

server: Fix Update Operation #202

merged 2 commits into from
Jul 27, 2021

Conversation

dave-tucker
Copy link
Collaborator

The update operation wasn't working :(
This commit fixes it such that:

  • It checks the fields sent in the Update RPC
  • For each field, it attempts to info.SetField in the matching row
  • Calls cache.Update to commit changes

Fixes: #201

Signed-off-by: Dave Tucker dave@dtucker.co.uk

@dave-tucker
Copy link
Collaborator Author

@amorenoz there are tests in this PR commented out, which can be uncommented once #203 is fixed.

@coveralls
Copy link

coveralls commented Jul 16, 2021

Pull Request Test Coverage Report for Build 1070551716

  • 37 of 67 (55.22%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.5%) to 76.272%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cache/cache.go 0 1 0.0%
server/database.go 0 13 0.0%
server/transact.go 37 53 69.81%
Files with Coverage Reduction New Missed Lines %
server/transact.go 1 60.57%
Totals Coverage Status
Change from base Build 1067951928: 0.5%
Covered Lines: 3282
Relevant Lines: 4303

💛 - Coveralls

The update operation wasn't working :(
This commit fixes it such that:
- It checks the fields sent in the Update RPC
- For each field, it attempts to info.SetField in the matching row
- Calls `cache.Update` to commit changes

Fixes: ovn-org#201

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
@dave-tucker dave-tucker merged commit 08dabaa into ovn-org:main Jul 27, 2021
JacobTanenbaum added a commit to JacobTanenbaum/ovn-kubernetes that referenced this pull request Jul 28, 2021
JacobTanenbaum added a commit to JacobTanenbaum/ovn-kubernetes that referenced this pull request Jul 28, 2021
pulls in ovn-org/libovsdb#202

Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com>
JacobTanenbaum added a commit to JacobTanenbaum/ovn-kubernetes that referenced this pull request Jul 29, 2021
pulls in ovn-org/libovsdb#202

Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating an object by specifying .Update(obj, fields...) panics when running in-memory
2 participants