File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
internal/dataplane/kongstate Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,10 @@ Adding a new version? You'll need three changes:
121121 DBLess mode in the translator of ingress-controller. This enables user to use
122122 explicit ` null ` s in plugins.
123123 [ #7751 ] ( https://github.com/Kong/kubernetes-ingress-controller/pull/7751 )
124+ - Translate ` healtchchecks.thershold ` in ` KongUpstreamPolicy ` to the
125+ ` healthchecks.thershold ` field in Kong upstreams.
126+ (Thanks to [ @elbrogan-vizio ] ( https://github.com/elbrogan-vizio ) who contributed to the fix.)
127+ [ #7784 ] ( https://github.com/Kong/kubernetes-ingress-controller/pull/7784 )
124128
125129## [ 3.5.2]
126130
Original file line number Diff line number Diff line change @@ -171,8 +171,9 @@ func translateHealthchecks(healthchecks *configurationv1beta1.KongUpstreamHealth
171171 return nil
172172 }
173173 return & kong.Healthcheck {
174- Active : translateActiveHealthcheck (healthchecks .Active ),
175- Passive : translatePassiveHealthcheck (healthchecks .Passive ),
174+ Active : translateActiveHealthcheck (healthchecks .Active ),
175+ Passive : translatePassiveHealthcheck (healthchecks .Passive ),
176+ Threshold : translateThreshold (healthchecks .Threshold ),
176177 }
177178}
178179
@@ -204,6 +205,13 @@ func translatePassiveHealthcheck(healthcheck *configurationv1beta1.KongUpstreamP
204205 }
205206}
206207
208+ func translateThreshold (threshold * int ) * float64 {
209+ if threshold == nil {
210+ return nil
211+ }
212+ return lo .ToPtr (float64 (* threshold ))
213+ }
214+
207215func translateHealthy (healthy * configurationv1beta1.KongUpstreamHealthcheckHealthy ) * kong.Healthy {
208216 if healthy == nil {
209217 return nil
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ func TestTranslateKongUpstreamPolicy(t *testing.T) {
383383 Timeouts : lo .ToPtr (120 ),
384384 },
385385 },
386- Threshold : lo .ToPtr (140 ),
386+ Threshold : lo .ToPtr (15 ),
387387 },
388388 },
389389 expectedUpstream : & kong.Upstream {
@@ -418,6 +418,7 @@ func TestTranslateKongUpstreamPolicy(t *testing.T) {
418418 Timeouts : lo .ToPtr (120 ),
419419 },
420420 },
421+ Threshold : lo .ToPtr (15.0 ),
421422 },
422423 },
423424 },
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ func TestKongUpstreamPolicyTranslation(t *testing.T) {
175175 Timeouts : lo .ToPtr (120 ),
176176 },
177177 },
178- Threshold : lo .ToPtr (140 ),
178+ Threshold : lo .ToPtr (10 ),
179179 },
180180 },
181181 expectedUpstream : & kong.Upstream {
@@ -214,7 +214,7 @@ func TestKongUpstreamPolicyTranslation(t *testing.T) {
214214 Timeouts : lo .ToPtr (120 ),
215215 },
216216 },
217- Threshold : lo .ToPtr (0. ),
217+ Threshold : lo .ToPtr (10.0 ),
218218 },
219219 },
220220 },
You can’t perform that action at this time.
0 commit comments