crazyMonkey1995 opened a new issue #722:
URL: https://github.com/apache/apisix-ingress-controller/issues/722
### Issue description
When create an empty apisixupstream, ingress-controller panic
### Environment
* your apisix-ingress-controller version 1.3.0
* your Kubernetes cluster version 1.18.20
### Minimal test code / Steps to reproduce the issue
apisixupstream.yaml
```
apiVersion: apisix.apache.org/v1
kind: ApisixUpstream
metadata:
name: whatEverSameAsTargetService
namespace: whatEverSameAsTargetService
```
kubectl apply -f apisixupstream.yaml ———created
kubectl describe apisixupstream -n whatEverSameAsTargetService
whatEverSameAsTargetService
```
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ResourcesSynced 4m22s ApisixIngress ApisixIngress synced
successfully
```
### What's the actual result? (including assertion message & call stack if
applicable)
apisxi-ingress-controller panic, output:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x17e5223]
goroutine 347 [running]:
github.com/apache/apisix-ingress-controller/pkg/ingress.(*Controller).syncEndpoint(0xc0003ea6c0,
0x1fdabe0, 0xc00003dfc0, 0x1fc4520, 0xc000414220, 0x0, 0x0)
/build/controller/pkg/ingress/controller.go:556 +0x223
github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).sync(...)
/build/controller/pkg/ingress/endpoint.go:87
github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).run.func1()
/build/controller/pkg/ingress/endpoint.go:72 +0x92
created by
github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).run
/build/controller/pkg/ingress/endpoint.go:79 +0x284
```
### What's the expected result?
Maybe create apisixupstream failed?(validate failed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]