8000 Fix panic when using Return or Redirect · nginx/kubernetes-ingress@4dca744 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4dca744

Browse files
committed
Fix panic when using Return or Redirect
1 parent f1bbdc7 commit 4dca744

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/configs/virtualserver.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ func newUpstreamNamerForTransportServer(transportServer *conf_v1alpha1.Transport
8484

8585
func (namer *upstreamNamer) GetNameForUpstreamFromAction(action *conf_v1.Action) string {
8686
var upstream string
87-
// Validation of the Action ensures only one (Pass or Proxy) is available.
88-
if action.Pass != "" {
89-
upstream = action.Pass
90-
} else {
87+
if action.Proxy != nil && action.Proxy.Upstream != "" {
9188
upstream = action.Proxy.Upstream
89+
} else {
90+
upstream = action.Pass
9291
}
9392

9493
return fmt.Sprintf("%s_%s", namer.prefix, upstream)

0 commit comments

Comments
 (0)
0