Skip to content

Commit

Permalink
Honor appropriately the value of ip_check_disabled (#51)
Browse files Browse the repository at this point in the history
When the aforementioned parameter has value of True, we should not
run any IP address assignment check but due to a bug this wasn't
happening, see the below:

```
11:56:06,834 anycast-healthchecker[3130997] DEBUG    foo.bar.com  ip_check_disabled=True:<class 'bool'>
11:56:06,834 anycast-healthchecker[3130997] DEBUG    foo.bar.com  custom_bird_reconfigure_cmd_timeout=2.0:<class 'float'>
11:56:06,835 anycast-healthchecker[3130997] INFO     foo.bar.com  checking for IP assignment on interface lo is disabled
11:56:06,835 anycast-healthchecker[3130997] DEBUG    foo.bar.com  running /sbin/ip address show dev lo to 10.52.12.1/32
11:56:06,839 anycast-healthchecker[3130997] DEBUG    foo.bar.com  10.52.12.1/32 assigned to lo interface
```

With this commit in place, we don't perform the IP address assignment
check:
```
11:56:28,232 anycast-healthchecker[3132569] DEBUG    foo.bar.com  ip_check_disabled=True:<class 'bool'>
11:56:28,232 anycast-healthchecker[3132569] DEBUG    foo.bar.com  custom_bird_reconfigure_cmd_timeout=2.0:<class 'float'>
11:56:28,232 anycast-healthchecker[3132569] INFO     foo.bar.com  checking for IP assignment on interface lo is disabled
11:56:28,233 anycast-healthchecker[3132569] INFO     foo.bar.com  running curl -A anycast-healthchecker --fail --silent -o /dev/null http://10.52.12.1:8888
```

Fixes #50
  • Loading branch information
unixsurfer authored Oct 19, 2024
1 parent 5ec2030 commit 0af86ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion anycast_healthchecker/servicecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _ip_assigned(self):
if self.ip_check_disabled:
self.log.info("checking for IP assignment on interface %s is "
"disabled", self.config['interface'])
result = True
return True

self.log.debug("running %s", ' '.join(cmd))
try:
Expand Down
2 changes: 1 addition & 1 deletion local_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ check_fail = 2
check_disabled = false
on_disabled = withdraw
ip_prefix = fd12:aba6:57db:ffff::1/128
ip_check_disabled = false
ip_check_disabled = true
EOT
fi

Expand Down

0 comments on commit 0af86ca

Please sign in to comment.