Skip to content

Commit 49ddc53

Browse files
authored
Merge pull request #278 from pleshakov/fix-mergeable-ingresses
Fix mergeable Ingress types
2 parents 9b6a367 + 9735a2c commit 49ddc53

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

nginx-controller/nginx/configurator.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,15 @@ func (cnf *Configurator) generateNginxCfg(ingEx *IngressEx, pems map[string]stri
244244
rootLocation := false
245245

246246
grpcOnly := true
247-
for _, path := range rule.HTTP.Paths {
248-
if _, exists := grpcServices[path.Backend.ServiceName]; !exists {
249-
grpcOnly = false
250-
break
247+
if len(grpcServices) > 0 {
248+
for _, path := range rule.HTTP.Paths {
249+
if _, exists := grpcServices[path.Backend.ServiceName]; !exists {
250+
grpcOnly = false
251+
break
252+
}
251253
}
254+
} else {
255+
grpcOnly = false
252256
}
253257

254258
for _, path := range rule.HTTP.Paths {

0 commit comments

Comments
 (0)