Using this package without ipvs doesn't return error
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 110
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
I use you example, slightly modified;
package main
import (
"log"
"github.com/moby/ipvs"
)
func main() {
handle, err := ipvs.New("")
if err != nil {
log.Fatalf("ipvs.New: %s", err)
}
log.Println("ipvs.New did NOT give an error!!")
_, err = handle.GetServices()
if err != nil {
log.Fatalf("handle.GetServices: %s", err)
}
log.Println("handle.GetServices did NOT give an error!!")
}
And run on a kernel where ipvs is not configured. Output:
# moby-example
WARN[0000] Running modprobe ip_vs failed with message: `modprobe: WARNING: Module ip_vs not found in directory /lib/modules/6.1.0`, error: exit status 1
ERRO[0000] Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this is fixed.
2022/12/23 18:09:43 ipvs.New did NOT give an error!!
2022/12/23 18:09:43 handle.GetServices did NOT give an error!!
So, that ipvs can't be loaded is obviously noted, but even so err==nil is returned.
This is a serious bug, which enforces weird work-arounds do detect if ipvs can be used:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Go example on a kernel without IPVS and inspect the behavior of ipvs.New and handle.GetServices. Trace how the failed IPVS setup is reported, then make the unavailable-kernel case return an error from the appropriate API and verify that the example no longer logs successful initialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100