Skip to content

Commit 7238747

Browse files
committed
Update tag 4.25.0-20241010 in docs and files
1 parent b5eb523 commit 7238747

26 files changed

+328
-190
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ body:
5656
attributes:
5757
label: Docker Selenium version (image tag)
5858
description: What version of Docker Selenium are you using?
59-
placeholder: 4.25.0-20240922? Please use the full tag, avoid "latest"
59+
placeholder: 4.25.0-20241010? Please use the full tag, avoid "latest"
6060
validations:
6161
required: true
6262
- type: input

.keda/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The stable implementation will be merged to the upstream KEDA repository frequen
1313
Replace the image registry and tag of these KEDA components with the patched image tag:
1414

1515
```bash
16-
docker pull selenium/keda:2.15.1-selenium-grid-20240922
17-
docker pull selenium/keda-metrics-apiserver:2.15.1-selenium-grid-20240922
18-
docker pull selenium/keda-admission-webhooks:2.15.1-selenium-grid-20240922
16+
docker pull selenium/keda:2.15.1-selenium-grid-20241010
17+
docker pull selenium/keda-metrics-apiserver:2.15.1-selenium-grid-20241010
18+
docker pull selenium/keda-admission-webhooks:2.15.1-selenium-grid-20241010
1919
```
2020

2121
Besides that, you also can use image tag `latest` or `nightly`.
@@ -27,15 +27,15 @@ If you are deploying KEDA core using their official Helm [chart](https://github.
2727
keda:
2828
registry: selenium
2929
repository: keda
30-
tag: "2.15.1-selenium-grid-20240922"
30+
tag: "2.15.1-selenium-grid-20241010"
3131
metricsApiServer:
3232
registry: selenium
3333
repository: keda-metrics-apiserver
34-
tag: "2.15.1-selenium-grid-20240922"
34+
tag: "2.15.1-selenium-grid-20241010"
3535
webhooks:
3636
registry: selenium
3737
repository: keda-admission-webhooks
38-
tag: "2.15.1-selenium-grid-20240922"
38+
tag: "2.15.1-selenium-grid-20241010"
3939
```
4040
4141
If you are deployment Selenium Grid chart with `autoscaling.enabled` is `true` (implies installing KEDA sub-chart), KEDA images registry and tag already set in the `values.yaml`. Refer to list [configuration](../charts/selenium-grid/CONFIGURATION.md).

.keda/scalers/selenium_grid_scaler.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ type seleniumGridScaler struct {
2828
type seleniumGridScalerMetadata struct {
2929
triggerIndex int
3030

31-
URL string `keda:"name=url, order=triggerMetadata;authParams"`
32-
Username string `keda:"name=username, order=triggerMetadata;authParams, optional"`
33-
Password string `keda:"name=password, order=triggerMetadata;authParams, optional"`
31+
URL string `keda:"name=url, order=authParams;triggerMetadata"`
32+
AuthType string `keda:"name=authType, order=authParams;resolvedEnv, optional"`
33+
Username string `keda:"name=username, order=authParams;resolvedEnv, optional"`
34+
Password string `keda:"name=password, order=authParams;resolvedEnv, optional"`
35+
AccessToken string `keda:"name=accessToken, order=authParams;resolvedEnv, optional"`
3436
BrowserName string `keda:"name=browserName, order=triggerMetadata"`
3537
SessionBrowserName string `keda:"name=sessionBrowserName, order=triggerMetadata, optional"`
3638
ActivationThreshold int64 `keda:"name=activationThreshold, order=triggerMetadata, optional"`
@@ -196,8 +198,10 @@ func (s *seleniumGridScaler) getSessionsCount(ctx context.Context, logger logr.L
196198
return -1, err
197199
}
198200

199-
if s.metadata.Username != "" && s.metadata.Password != "" {
201+
if (s.metadata.AuthType == "" || strings.EqualFold(s.metadata.AuthType, "Basic")) && s.metadata.Username != "" && s.metadata.Password != "" {
200202
req.SetBasicAuth(s.metadata.Username, s.metadata.Password)
203+
} else if !strings.EqualFold(s.metadata.AuthType, "Basic") && s.metadata.AccessToken != "" {
204+
req.Header.Set("Authorization", fmt.Sprintf("%s %s", s.metadata.AuthType, s.metadata.AccessToken))
201205
}
202206

203207
res, err := s.httpClient.Do(req)

.keda/scalers/selenium_grid_scaler_test.go

+137-3
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,34 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
16421642
NodeMaxSessions: 1,
16431643
},
16441644
},
1645+
{
1646+
name: "valid username and password in AuthParams, url, browsername, and sessionbrowsername should return metadata",
1647+
args: args{
1648+
config: &scalersconfig.ScalerConfig{
1649+
AuthParams: map[string]string{
1650+
"username": "username",
1651+
"password": "password",
1652+
},
1653+
TriggerMetadata: map[string]string{
1654+
"url": "http://selenium-hub:4444/graphql",
1655+
"browserName": "MicrosoftEdge",
1656+
"sessionBrowserName": "msedge",
1657+
},
1658+
},
1659+
},
1660+
wantErr: false,
1661+
want: &seleniumGridScalerMetadata{
1662+
URL: "http://selenium-hub:4444/graphql",
1663+
BrowserName: "MicrosoftEdge",
1664+
SessionBrowserName: "msedge",
1665+
TargetValue: 1,
1666+
BrowserVersion: "latest",
1667+
PlatformName: "linux",
1668+
Username: "username",
1669+
Password: "password",
1670+
NodeMaxSessions: 1,
1671+
},
1672+
},
16451673
{
16461674
name: "valid url and browsername should return metadata",
16471675
args: args{
@@ -1761,20 +1789,22 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
17611789
},
17621790
},
17631791
{
1764-
name: "valid url, browsername, unsafeSsl, activationThreshold, nodeMaxSessions and platformName should return metadata",
1792+
name: "valid url, browsername, unsafeSsl, activationThreshold, nodeMaxSessions and platformName with trigger auth params should return metadata",
17651793
args: args{
17661794
config: &scalersconfig.ScalerConfig{
17671795
TriggerMetadata: map[string]string{
17681796
"url": "http://selenium-hub:4444/graphql",
1769-
"username": "user",
1770-
"password": "password",
17711797
"browserName": "chrome",
17721798
"browserVersion": "91.0",
17731799
"unsafeSsl": "true",
17741800
"activationThreshold": "10",
17751801
"platformName": "Windows 11",
17761802
"nodeMaxSessions": "3",
17771803
},
1804+
AuthParams: map[string]string{
1805+
"username": "user",
1806+
"password": "password",
1807+
},
17781808
},
17791809
},
17801810
wantErr: false,
@@ -1792,6 +1822,110 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
17921822
NodeMaxSessions: 3,
17931823
},
17941824
},
1825+
{
1826+
name: "url in trigger auth param takes precedence over url in trigger metadata",
1827+
args: args{
1828+
config: &scalersconfig.ScalerConfig{
1829+
TriggerMetadata: map[string]string{
1830+
"url": "http://invalid.dns:4444/graphql",
1831+
"browserName": "chrome",
1832+
"browserVersion": "91.0",
1833+
"unsafeSsl": "true",
1834+
"activationThreshold": "10",
1835+
"platformName": "Windows 11",
1836+
"nodeMaxSessions": "3",
1837+
},
1838+
AuthParams: map[string]string{
1839+
"url": "http://selenium-hub:4444/graphql",
1840+
"username": "user",
1841+
"password": "password",
1842+
},
1843+
},
1844+
},
1845+
wantErr: false,
1846+
want: &seleniumGridScalerMetadata{
1847+
URL: "http://selenium-hub:4444/graphql",
1848+
Username: "user",
1849+
Password: "password",
1850+
BrowserName: "chrome",
1851+
SessionBrowserName: "chrome",
1852+
TargetValue: 1,
1853+
ActivationThreshold: 10,
1854+
BrowserVersion: "91.0",
1855+
UnsafeSsl: true,
1856+
PlatformName: "Windows 11",
1857+
NodeMaxSessions: 3,
1858+
},
1859+
},
1860+
{
1861+
name: "auth type is not Basic and access token is provided",
1862+
args: args{
1863+
config: &scalersconfig.ScalerConfig{
1864+
TriggerMetadata: map[string]string{
1865+
"url": "http://selenium-hub:4444/graphql",
1866+
"browserName": "chrome",
1867+
"browserVersion": "91.0",
1868+
"unsafeSsl": "true",
1869+
"activationThreshold": "10",
1870+
"platformName": "Windows 11",
1871+
"nodeMaxSessions": "3",
1872+
},
1873+
AuthParams: map[string]string{
1874+
"url": "http://selenium-hub:4444/graphql",
1875+
"authType": "OAuth2",
1876+
"accessToken": "my-access-token",
1877+
},
1878+
},
1879+
},
1880+
wantErr: false,
1881+
want: &seleniumGridScalerMetadata{
1882+
URL: "http://selenium-hub:4444/graphql",
1883+
AuthType: "OAuth2",
1884+
AccessToken: "my-access-token",
1885+
BrowserName: "chrome",
1886+
SessionBrowserName: "chrome",
1887+
TargetValue: 1,
1888+
ActivationThreshold: 10,
1889+
BrowserVersion: "91.0",
1890+
UnsafeSsl: true,
1891+
PlatformName: "Windows 11",
1892+
NodeMaxSessions: 3,
1893+
},
1894+
},
1895+
{
1896+
name: "authenticating with bearer access token",
1897+
args: args{
1898+
config: &scalersconfig.ScalerConfig{
1899+
TriggerMetadata: map[string]string{
1900+
"browserName": "chrome",
1901+
"browserVersion": "91.0",
1902+
"unsafeSsl": "true",
1903+
"activationThreshold": "10",
1904+
"platformName": "Windows 11",
1905+
"nodeMaxSessions": "3",
1906+
},
1907+
AuthParams: map[string]string{
1908+
"url": "http://selenium-hub:4444/graphql",
1909+
"authType": "Bearer",
1910+
"accessToken": "my-access-token",
1911+
},
1912+
},
1913+
},
1914+
wantErr: false,
1915+
want: &seleniumGridScalerMetadata{
1916+
URL: "http://selenium-hub:4444/graphql",
1917+
AuthType: "Bearer",
1918+
AccessToken: "my-access-token",
1919+
BrowserName: "chrome",
1920+
SessionBrowserName: "chrome",
1921+
TargetValue: 1,
1922+
ActivationThreshold: 10,
1923+
BrowserVersion: "91.0",
1924+
UnsafeSsl: true,
1925+
PlatformName: "Windows 11",
1926+
NodeMaxSessions: 3,
1927+
},
1928+
},
17951929
}
17961930
for _, tt := range tests {
17971931
t.Run(tt.name, func(t *testing.T) {

NodeDocker/config.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
33
# start a container with the given image.
44
configs = [
5-
"selenium/standalone-firefox:4.25.0-20240922", '{"browserName": "firefox", "platformName": "linux"}',
6-
"selenium/standalone-chrome:4.25.0-20240922", '{"browserName": "chrome", "platformName": "linux"}',
7-
"selenium/standalone-edge:4.25.0-20240922", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
5+
"selenium/standalone-firefox:4.25.0-20241010", '{"browserName": "firefox", "platformName": "linux"}',
6+
"selenium/standalone-chrome:4.25.0-20241010", '{"browserName": "chrome", "platformName": "linux"}',
7+
"selenium/standalone-edge:4.25.0-20241010", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
88
]
99

1010
# URL for connecting to the docker daemon
@@ -14,7 +14,7 @@ configs = [
1414
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
1515
url = "http://127.0.0.1:2375"
1616
# Docker image used for video recording
17-
video-image = "selenium/video:ffmpeg-7.0.2-20240922"
17+
video-image = "selenium/video:ffmpeg-7.0.2-20241010"
1818

1919
# Uncomment the following section if you are running the node on a separate VM
2020
# Fill out the placeholders with appropriate values

0 commit comments

Comments
 (0)