Skip to content

Commit c736f43

Browse files
committed
fix(hub): 🐛 correct apiManagement openApi refreshInterval default and gate
1 parent 0578ea0 commit c736f43

6 files changed

Lines changed: 20 additions & 7 deletions

File tree

traefik/VALUES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Kubernetes: `>=1.25.0-0`
146146
| hub.apimanagement.admission.secretName | string | `"hub-agent-cert"` | Certificate name of the WebHook admission server. Default: "hub-agent-cert". |
147147
| hub.apimanagement.admission.selfManagedCertificate | bool | `false` | By default, this chart handles directly the tls certificate required for the admission webhook. It's possible to disable this behavior and handle it outside of the chart. See EXAMPLES.md for more details. |
148148
| hub.apimanagement.enabled | bool | `false` | Set to true in order to enable API Management. Requires a valid license token. |
149-
| hub.apimanagement.openApi.refreshInterval | string | `""` | Interval to refresh the OpenAPI specification, as a Go duration. When empty, the provider default (`0`, disabled) applies. |
149+
| hub.apimanagement.openApi.refreshInterval | string | `""` | Interval to refresh the OpenAPI specification, as a Go duration. Must be at least `1m`. When empty, the Traefik Hub default (`1m`) applies. |
150150
| hub.apimanagement.openApi.validateRequestMethodAndPath | bool | `false` | When set to true, it will only accept paths and methods that are explicitly defined in its OpenAPI specification |
151151
| hub.enabled | bool | `true` when `hub.token` is set | Install Traefik Hub. Without `hub.token`, it runs in proxy mode: a drop-in Traefik Proxy, which requires Traefik Hub >= v3.21.0-ea. |
152152
| hub.hardened | bool | `false` | Use the hardened image variant. It appends `-hardened` to the tag and defaults the image to `registry.traefik.io/traefik-hub`. Requires `hub.enabled` and Traefik Hub >= v3.21.0-ea. |

traefik/templates/requirements.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
{{ fail "ERROR: hub.hardened is only available for Traefik Hub >= v3.21.0-ea, set image.tag accordingly." }}
228228
{{- end }}
229229

230-
{{- if and $.Values.hub.apimanagement.openApi.refreshInterval (semverCompare "<v3.21.0-0" $hubVersion) }}
230+
{{- if and $.Values.hub.apimanagement.enabled $.Values.hub.apimanagement.openApi.refreshInterval (semverCompare "<v3.21.0-0" $hubVersion) }}
231231
{{ fail "ERROR: hub.apimanagement.openApi.refreshInterval is only available for Traefik Hub >= v3.21.0." }}
232232
{{- end }}
233233

traefik/tests/hub-apigateway-config_test.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ tests:
160160
apimanagement:
161161
enabled: true
162162
asserts:
163-
- notContains:
164-
path: spec.template.spec.containers[0].args
165-
content: "--hub.apiManagement.openApi.refreshInterval="
163+
- notMatchRegexRaw:
164+
pattern: "--hub\\.apiManagement\\.openApi\\.refreshInterval"
166165
- it: api management and ai gateway should not be enabled by default
167166
asserts:
168167
- notContains:

traefik/tests/requirements-config_test.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,20 @@ tests:
895895
refreshInterval: "5m"
896896
asserts:
897897
- notFailedTemplate: {}
898+
- it: should pass when apiManagement openApi refreshInterval is set but apiManagement is disabled
899+
set:
900+
image:
901+
registry: "ghcr.io"
902+
repository: "traefik/traefik-hub"
903+
tag: v3.20.7
904+
hub:
905+
token: "xxx"
906+
apimanagement:
907+
enabled: false
908+
openApi:
909+
refreshInterval: "5m"
910+
asserts:
911+
- notFailedTemplate: {}
898912
- it: should fail when using pluginRegistry sources with unused plugin
899913
set:
900914
image:

traefik/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@
774774
"type": "object",
775775
"properties": {
776776
"refreshInterval": {
777-
"description": "Interval to refresh the OpenAPI specification, as a Go duration. When empty, the provider default (`0`, disabled) applies.",
777+
"description": "Interval to refresh the OpenAPI specification, as a Go duration. Must be at least `1m`. When empty, the Traefik Hub default (`1m`) applies.",
778778
"type": "string"
779779
},
780780
"validateRequestMethodAndPath": {

traefik/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ hub: # @schema additionalProperties: false
13271327
openApi:
13281328
# -- When set to true, it will only accept paths and methods that are explicitly defined in its OpenAPI specification
13291329
validateRequestMethodAndPath: false
1330-
# -- Interval to refresh the OpenAPI specification, as a Go duration. When empty, the provider default (`0`, disabled) applies.
1330+
# -- Interval to refresh the OpenAPI specification, as a Go duration. Must be at least `1m`. When empty, the Traefik Hub default (`1m`) applies.
13311331
refreshInterval: ""
13321332

13331333
mcpgateway:

0 commit comments

Comments
 (0)