We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 739b29a + 3187041 commit 0a72772Copy full SHA for 0a72772
pkg/gateway/server.go
@@ -161,7 +161,7 @@ func (srv *Server) newProto(conn net.Conn) (Protocol, error) {
161
// find all virtual services that bound to the gateway
162
fn := func(key, value interface{}) bool {
163
if vs, ok := value.(*istioapi.VirtualService); ok {
164
- if vs.Spec.Gateways[0] == srv.options.GwName &&
+ if len(vs.Spec.Gateways) > 0 && vs.Spec.Gateways[0] == srv.options.GwName &&
165
reflect.DeepEqual(vs.Spec.Hosts, srv.options.Hosts) {
166
vss = append(vss, vs)
167
}
0 commit comments