minio / sidekick

High Performance HTTP Sidecar Load Balancer
GNU Affero General Public License v3.0
540 stars 82 forks source link

Sidekick does not work in a ipv6 only environment #103

Closed thel1988 closed 5 months ago

thel1988 commented 6 months ago

Sidekick does not work in a ipv6 only environment, only if a ipv4 address is assigned you are able to start sidekick

Expected Behavior

Sidekick should be able to start in a ipv6,(I hope) only environment.

/usr/bin/sidekick --health-path=/minio/health/ready  --cacert=/pack/sidekick/ca-chain.pem https://minio-node01-c01.xxxx.xxxx:9000
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.getPublicIP()
    github.com/minio/sidekick/main.go:715 +0x125
main.configureSite(0xc000093a00, 0x1, {0xc0002c8130, 0x1, 0x0?}, {0x7fffeabc281e, 0x13}, 0xc0002be750?, 0x12a05f200)
    github.com/minio/sidekick/main.go:783 +0x9b9
main.sidekickMain(0xc000093a00)
    github.com/minio/sidekick/main.go:877 +0x693
github.com/minio/cli.HandleAction({0x9dfa40?, 0xb06c58?}, 0xc0001ba840?)
    github.com/minio/cli@v1.24.2/app.go:492 +0x70
github.com/minio/cli.(*App).Run(0xc000162a80, {0xc0000d8040, 0x4, 0x4})
    github.com/minio/cli@v1.24.2/app.go:269 +0x705
main.main()
    github.com/minio/sidekick/main.go:1056 +0x108a

Current Behavior

When you only have ipv6 address raised on your server, the above error is thrown, not able to start. But if you assign a dummy ip. through netplan eg: 192.168.27.2/32 It starts just fine

Possible Solution

Should be able to start on a ipv6 only server

Steps to Reproduce (for bugs)

  1. create a server env with only ipv6, not including loopback interfaces
  2. install sidekick
  3. Run sidekick with: /usr/bin/sidekick --health-path=/minio/health/ready --cacert=/pack/sidekick/ca-chain.pem https://minio-node01-c01.xxxx.xxxx:9000

Context

Trying to test out sidekick, if that is something we can use in our environment, also ipv6 only system.

Regression

Your Environment