Skip to content

Commit 1dedde7

Browse files
committed
K8s: Update KEDA patch version in default chart
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent a195077 commit 1dedde7

File tree

5 files changed

+98
-25
lines changed

5 files changed

+98
-25
lines changed

.keda/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ You can involve to review and discuss the pull requests to help us early detect
4949

5050
[kedacore/keda](https://github.com/kedacore/keda)
5151

52+
- https://github.com/kedacore/keda/pull/6477
53+
5254
- ~~https://github.com/kedacore/keda/pull/6437 (merged, v2.16.1)~~
5355

5456
- ~~https://github.com/kedacore/keda/pull/6368 (merged, v2.16.1)~~
@@ -57,6 +59,8 @@ You can involve to review and discuss the pull requests to help us early detect
5759

5860
[kedacore/keda-docs](https://github.com/kedacore/keda-docs)
5961

62+
- https://github.com/kedacore/keda-docs/pull/1522
63+
6064
- https://github.com/kedacore/keda-docs/pull/1515
6165

6266
- ~~https://github.com/kedacore/keda-docs/pull/1468 (merged, v2.16.0)~~

.keda/scalers/selenium-grid-scaler.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ triggers:
2222
url: 'http://selenium-hub:4444/graphql' # Required. Can be ommitted if specified via TriggerAuthentication/ClusterTriggerAuthentication.
2323
browserName: '' # Optional. Required to be matched with the request in queue and Node stereotypes (Similarly for `browserVersion` and `platformName`).
2424
browserVersion: '' # Optional.
25-
platformName: 'linux' # Optional.
25+
platformName: '' # Optional.
2626
unsafeSsl : 'false' # Optional.
2727
activationThreshold: 0 # Optional.
2828
```
@@ -35,7 +35,7 @@ triggers:
3535
- `browserVersion` - Version of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
3636
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)
3737
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
38-
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Default: `Linux`, Optional)
38+
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
3939
- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional).
4040

4141
**Trigger Authentication**
@@ -66,6 +66,8 @@ spec:
6666
env:
6767
- name: SE_NODE_BROWSER_VERSION
6868
value: ''
69+
- name: SE_NODE_PLATFORM_NAME
70+
value: 'Linux'
6971
7072
---
7173

.keda/scalers/selenium_grid_scaler.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -251,35 +251,34 @@ func countMatchingSessions(sessions Sessions, browserName string, browserVersion
251251
// This function checks if the request capabilities match the scaler metadata
252252
func checkRequestCapabilitiesMatch(request Capability, browserName string, browserVersion string, _ string, platformName string) bool {
253253
// Check if browserName matches
254-
browserNameMatch := request.BrowserName == "" && browserName == "" ||
254+
browserNameMatch := (request.BrowserName == "" && browserName == "") ||
255255
strings.EqualFold(browserName, request.BrowserName)
256256

257257
// Check if browserVersion matches
258258
browserVersionMatch := (request.BrowserVersion == "" && browserVersion == "") ||
259-
(request.BrowserVersion == "stable" && browserVersion == "") ||
260-
(strings.HasPrefix(browserVersion, request.BrowserVersion) && request.BrowserVersion != "" && browserVersion != "")
259+
(request.BrowserVersion != "" && strings.HasPrefix(browserVersion, request.BrowserVersion))
261260

262261
// Check if platformName matches
263-
platformNameMatch := request.PlatformName == "" && platformName == "" ||
264-
strings.EqualFold(platformName, request.PlatformName)
262+
platformNameMatch := (request.PlatformName == "" || strings.EqualFold("any", request.PlatformName) || strings.EqualFold(platformName, request.PlatformName)) &&
263+
(platformName == "" || platformName == "any" || strings.EqualFold(platformName, request.PlatformName))
265264

266265
return browserNameMatch && browserVersionMatch && platformNameMatch
267266
}
268267

269268
// This function checks if Node stereotypes or ongoing sessions match the scaler metadata
270269
func checkStereotypeCapabilitiesMatch(capability Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string) bool {
271270
// Check if browserName matches
272-
browserNameMatch := capability.BrowserName == "" && browserName == "" ||
271+
browserNameMatch := (capability.BrowserName == "" && browserName == "") ||
273272
strings.EqualFold(browserName, capability.BrowserName) ||
274273
strings.EqualFold(sessionBrowserName, capability.BrowserName)
275274

276275
// Check if browserVersion matches
277-
browserVersionMatch := capability.BrowserVersion == "" && browserVersion == "" ||
278-
(strings.HasPrefix(browserVersion, capability.BrowserVersion) && capability.BrowserVersion != "" && browserVersion != "")
276+
browserVersionMatch := (capability.BrowserVersion == "" && browserVersion == "") ||
277+
(capability.BrowserVersion != "" && strings.HasPrefix(browserVersion, capability.BrowserVersion))
279278

280279
// Check if platformName matches
281-
platformNameMatch := capability.PlatformName == "" && platformName == "" ||
282-
strings.EqualFold(platformName, capability.PlatformName)
280+
platformNameMatch := (capability.PlatformName == "" || strings.EqualFold("any", capability.PlatformName) || strings.EqualFold(platformName, capability.PlatformName)) &&
281+
(platformName == "" || platformName == "any" || strings.EqualFold(platformName, capability.PlatformName))
283282

284283
return browserNameMatch && browserVersionMatch && platformNameMatch
285284
}

.keda/scalers/selenium_grid_scaler_test.go

+68
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,74 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
10421042
wantOnGoingSessions: 2,
10431043
wantErr: false,
10441044
},
1045+
{
1046+
name: "1 queue request without platformName and scaler metadata without platfromName should return 1 new node and 1 ongoing session",
1047+
args: args{
1048+
b: []byte(`{
1049+
"data": {
1050+
"grid": {
1051+
"sessionCount": 2,
1052+
"maxSession": 2,
1053+
"totalSlots": 2
1054+
},
1055+
"nodesInfo": {
1056+
"nodes": [
1057+
{
1058+
"id": "node-1",
1059+
"status": "UP",
1060+
"sessionCount": 1,
1061+
"maxSession": 1,
1062+
"slotCount": 1,
1063+
"stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"platformName\": \"any\"}}]",
1064+
"sessions": [
1065+
{
1066+
"id": "session-1",
1067+
"capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"any\"}",
1068+
"slot": {
1069+
"id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
1070+
"stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"any\"}"
1071+
}
1072+
}
1073+
]
1074+
},
1075+
{
1076+
"id": "node-2",
1077+
"status": "UP",
1078+
"sessionCount": 1,
1079+
"maxSession": 1,
1080+
"slotCount": 1,
1081+
"stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"platformName\": \"linux\"}}]",
1082+
"sessions": [
1083+
{
1084+
"id": "session-2",
1085+
"capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}",
1086+
"slot": {
1087+
"id": "9ce1edba-72fb-465e-b311-ee473d8d7b64",
1088+
"stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}"
1089+
}
1090+
}
1091+
]
1092+
}
1093+
]
1094+
},
1095+
"sessionsInfo": {
1096+
"sessionQueueRequests": [
1097+
"{\"browserName\": \"chrome\", \"platformName\": \"linux\"}",
1098+
"{\"browserName\": \"chrome\"}",
1099+
"{\"browserName\": \"chrome\", \"platformName\": \"any\"}"
1100+
]
1101+
}
1102+
}
1103+
}`),
1104+
browserName: "chrome",
1105+
sessionBrowserName: "chrome",
1106+
browserVersion: "",
1107+
platformName: "",
1108+
},
1109+
wantNewRequestNodes: 2,
1110+
wantOnGoingSessions: 1,
1111+
wantErr: false,
1112+
},
10451113
{
10461114
name: "1 active session with matching browsername and version should return count as 2",
10471115
args: args{

charts/selenium-grid/values.yaml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1976,19 +1976,19 @@ customLabels: {}
19761976
keda:
19771977
# enabled: false
19781978
# -- Specify image for KEDA components
1979-
# image:
1980-
# keda:
1981-
# registry: selenium
1982-
# repository: keda
1983-
# tag: "2.16.1-selenium-grid-20250101"
1984-
# metricsApiServer:
1985-
# registry: selenium
1986-
# repository: keda-metrics-apiserver
1987-
# tag: "2.16.1-selenium-grid-20250101"
1988-
# webhooks:
1989-
# registry: selenium
1990-
# repository: keda-admission-webhooks
1991-
# tag: "2.16.1-selenium-grid-20250101"
1979+
image:
1980+
keda:
1981+
registry: selenium
1982+
repository: keda
1983+
tag: "2.16.1-selenium-grid-20250101"
1984+
metricsApiServer:
1985+
registry: selenium
1986+
repository: keda-metrics-apiserver
1987+
tag: "2.16.1-selenium-grid-20250101"
1988+
webhooks:
1989+
registry: selenium
1990+
repository: keda-admission-webhooks
1991+
tag: "2.16.1-selenium-grid-20250101"
19921992
# -- Annotations for KEDA resources
19931993
additionalAnnotations:
19941994
http:

0 commit comments

Comments
 (0)