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

Crashes with ExternalName service #336

Closed
abh opened this issue May 8, 2019 · 3 comments
Closed

Crashes with ExternalName service #336

abh opened this issue May 8, 2019 · 3 comments

Comments

@abh
Copy link
Contributor

abh commented May 8, 2019

In an older cluster I had a service with an externalName service. Moving to a new cluster with a newer haproxy-ingress, the ingress crashes with this.

{
    "kind": "Service",
    "apiVersion": "v1",
    "metadata": {
        "name": "github"
    },
    "spec": {
        "type": "ExternalName",
        "externalName": "www.github.com",
        "ports": [{ "port": 80 }]
    }
}```
@abh
Copy link
Contributor Author

abh commented May 8, 2019

This makes it not crash (but doesn't make the ExternalService work).

diff --git a/pkg/controller/dynconfig/dynconfig.go b/pkg/controller/dynconfig/dynconfig.go
index e38ad8d..508b9c1 100644
--- a/pkg/controller/dynconfig/dynconfig.go
+++ b/pkg/controller/dynconfig/dynconfig.go
@@ -18,6 +18,7 @@ package dynconfig
 
 import (
 	"fmt"
+	"log"
 	"reflect"
 	"sort"
 
@@ -359,6 +360,10 @@ func (d *DynConfig) fillBackendServerSlots() {
 			for _, endpoint := range d.updBackendsMap[backendName].Endpoints {
 				curEndpoint := endpoint
 				target := fmt.Sprintf("%s:%s", endpoint.Address, endpoint.Port)
+				if endpoint.Target == nil {
+					log.Printf("nil endpoint for %s %q", backendName, target)
+					continue
+				}
 				backendServerName := endpoint.Target.Name
 				if len(backendServerName) == 0 {
 					backendServerName = target

@abh
Copy link
Contributor Author

abh commented May 20, 2020

This seems to work with the 0.10 beta now. :-)

@abh abh closed this as completed May 20, 2020
@jcmoraisjr
Copy link
Owner

Hi, I definitely missed this issue; need to make a triage on all of the opened ones. Sorry about taking so long.

This was fixed on #455 and should work fine on the latest tag of all branches - currently v0.8.4, v0.9, and also v0.10-beta.1 as you pointed out.

Thanks for the report and feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants