From 9735a2c8e37478d05ed08b1f323af3d2a7b9ebd3 Mon Sep 17 00:00:00 2001 From: Michael Pleshakov Date: Mon, 30 Apr 2018 19:25:56 +0100 Subject: [PATCH] Fix mergeable Ingress types --- nginx-controller/nginx/configurator.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nginx-controller/nginx/configurator.go b/nginx-controller/nginx/configurator.go index 9f134bce91..7664f869ab 100644 --- a/nginx-controller/nginx/configurator.go +++ b/nginx-controller/nginx/configurator.go @@ -244,11 +244,15 @@ func (cnf *Configurator) generateNginxCfg(ingEx *IngressEx, pems map[string]stri rootLocation := false grpcOnly := true - for _, path := range rule.HTTP.Paths { - if _, exists := grpcServices[path.Backend.ServiceName]; !exists { - grpcOnly = false - break + if len(grpcServices) > 0 { + for _, path := range rule.HTTP.Paths { + if _, exists := grpcServices[path.Backend.ServiceName]; !exists { + grpcOnly = false + break + } } + } else { + grpcOnly = false } for _, path := range rule.HTTP.Paths {