bug: When the spec field of the ApisixUpstream resource is empty, it will panic #790
Labels
bug
Something isn't working
good second issue
Some small features, slightly more complicated than good first issue
help wanted
Extra attention is needed
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
An error occurred when I added this resource.
version: 1.3.0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x15fcef5]
goroutine 517 [running]:
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).TranslateUpstream(0xc000010ce8, 0xc0001c8140, 0xe, 0xc0001c8230, 0x10, 0x0, 0x0, 0xc000000050, 0x8, 0x8, ...)
/build/controller/pkg/kube/translation/translator.go:196 +0x395
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).translateUpstreamFromIngressV1(0xc000010ce8, 0xc0001c8140, 0xe, 0xc0006d08a0, 0x1, 0xc0005033b0, 0x0)
/build/controller/pkg/kube/translation/ingress.go:235 +0x94
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).translateIngressV1(0xc000010ce8, 0xc000766170, 0xd, 0x15e44f0, 0x1b3d900)
/build/controller/pkg/kube/translation/ingress.go:79 +0x92f
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).TranslateIngress(0xc000010ce8, 0x1fe3be0, 0xc0006d03f0, 0xc00066d36f, 0x10, 0x1fe3be0)
/build/controller/pkg/kube/translation/translator.go:255 +0x24c
github.com/apache/apisix-ingress-controller/pkg/ingress.(*ingressController).sync(0xc0003cd5e0, 0x1fdabe0, 0xc00003ca40, 0xc00081d050, 0x8, 0xc000604f80)
/build/controller/pkg/ingress/ingress.go:128 +0x2d3
github.com/apache/apisix-ingress-controller/pkg/ingress.(*ingressController).runWorker(0xc0003cd5e0, 0x1fdabe0, 0xc00003ca40)
/build/controller/pkg/ingress/ingress.go:78 +0x57
created by github.com/apache/apisix-ingress-controller/pkg/ingress.(*ingressController).run
/build/controller/pkg/ingress/ingress.go:67 +0x223
The text was updated successfully, but these errors were encountered: