Skip to content

Commit

Permalink
fix: retries can be set to 0 for services in Kong
Browse files Browse the repository at this point in the history
  • Loading branch information
cnef authored and hbagdi committed Dec 20, 2018
1 parent b1a8709 commit b8bb7bd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/apis/configuration/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Proxy struct {
Protocol string `json:"protocol"`
Path string `json:"path"`
ConnectTimeout int `json:"connect_timeout"`
Retries int `json:"retries"`
Retries *int `json:"retries"`
ReadTimeout int `json:"read_timeout"`
WriteTimeout int `json:"write_timeout"`
}
Expand Down
11 changes: 10 additions & 1 deletion internal/apis/configuration/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/ingress/controller/kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ func (n *NGINXController) syncServices(ingressCfg *ingress.Configuration) (bool,
outOfSync = true
}

if kongIngress.Proxy.Retries > 0 &&
(s.Retries == nil || *s.Retries != kongIngress.Proxy.Retries) {
s.Retries = kong.Int(kongIngress.Proxy.Retries)
if kongIngress.Proxy.Retries != nil &&
(s.Retries == nil || s.Retries != kongIngress.Proxy.Retries) {
s.Retries = kong.Int(*kongIngress.Proxy.Retries)
outOfSync = true
}
}
Expand Down

0 comments on commit b8bb7bd

Please sign in to comment.