Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: When the spec field of the ApisixUpstream resource is empty, it will panic #790

Closed
Brhetty opened this issue Dec 9, 2021 · 4 comments
Assignees
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.

Comments

@Brhetty
Copy link
Contributor

Brhetty commented Dec 9, 2021

An error occurred when I added this resource.
version: 1.3.0

apiVersion: apisix.apache.org/v1
kind: ApisixUpstream
metadata:
  name: apisix-dashboard

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

@tao12345666333 tao12345666333 added bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Dec 9, 2021
@tao12345666333
Copy link
Member

Thanks for your report. I have reproduced.

@tao12345666333 tao12345666333 changed the title request help: An error occurred when I added upstream resource bug: When the spec field of the ApisixUpstream resource is empty, it will panic Dec 9, 2021
@tao12345666333 tao12345666333 self-assigned this Dec 9, 2021
@tao12345666333
Copy link
Member

This is because we are not verifying its spec. Are you interested in helping to participate in the contribution?

@tao12345666333 tao12345666333 added good second issue Some small features, slightly more complicated than good first issue help wanted Extra attention is needed labels Dec 9, 2021
@Brhetty
Copy link
Contributor Author

Brhetty commented Dec 9, 2021

ok.

@tao12345666333
Copy link
Member

#794 has been merged. Thanks @Brhetty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants