Having VirtualService point to upstream with empty static.hosts configuration causes the gloo pod to panic on upstream validation when the upstream is primary target of a failoverscheme.
Steps to reproduce the bug
Setup 2 glooe clusters and register them for federation.
enable failover and apply following steps in local(mgmt) cluster
Configure static upstream with empty static.hosts and virtualservice routing to the upstream
This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.
Gloo Edge Version
1.10.x
Kubernetes Version
1.23.x
Describe the bug
Having VirtualService point to upstream with empty
static.hosts
configuration causes the gloo pod to panic on upstream validation when the upstream is primary target of a failoverscheme.Steps to reproduce the bug
static.hosts
and virtualservice routing to the upstreamkubectl apply -f - <<EOF apiVersion: fed.solo.io/v1 kind: FailoverScheme metadata: finalizers:
{"level":"info","ts":"2022-04-08T09:54:59.199Z","logger":"proxy-validator","caller":"validation/server.go:181","msg":"received proxy validation request"} panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x32bd8ea]
goroutine 554 [running]: github.com/solo-io/solo-projects/projects/gloo/pkg/plugins/failover.(failoverPluginImpl).ProcessUpstream(0xc001a43050, 0x4c52cf0, 0xc00300efc0, 0xc0017b8700, 0xc002eb89c0, 0xc002f3dc00, 0x0, 0x0) /workspace/solo-projects/projects/gloo/pkg/plugins/failover/plugin.go:137 +0x74a github.com/solo-io/gloo/projects/gloo/pkg/translator.(translatorInstance).computeCluster(0xc002db6e58, 0x4c52cf0, 0xc00300efc0, 0xc0017b8700, 0xc002eb89c0, 0xc00300ecc0, 0xc00300ec90, 0x0) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/translator/clusters.go:65 +0x22f github.com/solo-io/gloo/projects/gloo/pkg/translator.(translatorInstance).computeClusters(0xc002db6e58, 0x4c52cf0, 0xc00300ee40, 0xc0017b8700, 0xc00300ec90, 0xc00300ecc0, 0xc002de6300, 0x0, 0x0, 0x0, ...) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/translator/clusters.go:47 +0x39f github.com/solo-io/gloo/projects/gloo/pkg/translator.(translatorInstance).translateClusterSubsystemComponents(0xc002db6e58, 0x4c52cf0, 0xc00300e9c0, 0xc0017b8700, 0xc002de6300, 0xc00300ec90, 0x0, 0x0, 0x0, 0x0, ...) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/translator/translator.go:163 +0x436 github.com/solo-io/gloo/projects/gloo/pkg/translator.(translatorInstance).Translate(0xc002db6e58, 0x4c52cf0, 0xc00300e9c0, 0xc0017b8700, 0xc002de6300, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/translator/translator.go:119 +0x4f6 github.com/solo-io/gloo/projects/gloo/pkg/translator.(translatorFactory).Translate(0xc0017af4d0, 0x4c52cf0, 0xc00300e630, 0xc0017b8700, 0xc002de6300, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/translator/translator.go:79 +0x27f github.com/solo-io/gloo/projects/gloo/pkg/validation.(validator).Validate(0xc001bc9200, 0x4c52cf0, 0xc00300e630, 0xc002ea6a80, 0x0, 0x0, 0x0) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/validation/server.go:192 +0x472 github.com/solo-io/gloo/projects/gloo/pkg/validation.(validationServer).Validate(0xc000c0dfb0, 0x4c52cf0, 0xc002ee42d0, 0xc002ea6a80, 0x0, 0x0, 0x0) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/validation/server.go:350 +0xe2 github.com/solo-io/gloo/projects/gloo/pkg/api/grpc/validation._GlooValidationService_Validate_Handler(0x4348640, 0xc000c0dfb0, 0x4c52cf0, 0xc002ee42d0, 0xc002e14f00, 0x0, 0x0, 0x0, 0x0, 0x0) /go/pkg/mod/github.com/solo-io/gloo@v1.10.10/projects/gloo/pkg/api/grpc/validation/gloo_validation.pb.go:2621 +0x3d9 google.golang.org/grpc.(Server).processUnaryRPC(0xc000a3f880, 0x4c6c0f8, 0xc002363980, 0xc002e85d40, 0xc001c1fa40, 0x66787a0, 0x0, 0x0, 0x0) /go/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:1282 +0x105d google.golang.org/grpc.(Server).handleStream(0xc000a3f880, 0x4c6c0f8, 0xc002363980, 0xc002e85d40, 0x0) /go/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:1616 +0x9f9 google.golang.org/grpc.(Server).serveStreams.func1.2(0xc002e7abb0, 0xc000a3f880, 0x4c6c0f8, 0xc002363980, 0xc002e85d40) /go/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:921 +0xf4 created by google.golang.org/grpc.(Server).serveStreams.func1 /go/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:919 +0x2c5