calico
calico copied to clipboard
Add missing negation operator
Description
The GetFeatures
function correctly fills the RestoreSupportsLock
variable but IMO it's not used correctly afterwards. We fill iptablesLock
with a dummyLock
if RestoreSupportsLock
is true and with NewSharedLock(...)
output otherwise. I think this should be reversed.
Related issues/PRs
Todos
- [ ] Tests
- [ ] Documentation
- [ ] Release note
Release Note
TBD
TBD
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one docs-*
label.
-
docs-pr-required
: This change requires a change to the documentation that has not been completed yet. -
docs-completed
: This change has all necessary documentation completed. -
docs-not-required
: This change has no user-facing impact and requires no docs.
Every PR needs one release-note-*
label.
-
release-note-required
: This PR has user-facing changes. Most PRs should have this label. -
release-note-not-required
: This PR has no user-facing changes.
Other optional labels:
-
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only. -
needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.
@caseydavenport Would you please take a look at this 😄?
@therealak12 If I understand correctly, I think the current code is correct.
Basically, if the version of iptables supports locking natively, then Calico doesn't need to implement its own lock and can just use a dummy lock implementation.
However, if the version of iptables doesn't have native locking support, Calico uses its own implementation of a lock.
Oh thanks, you're right.