Skip to content

Commit 26c45cd

Browse files
committed
K8s: Config is true by default
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 1cca6ba commit 26c45cd

File tree

6 files changed

+151
-137
lines changed

6 files changed

+151
-137
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ triggers:
2323
browserName: '' # Optional. Required to be matched with the request in queue and Node stereotypes (Similarly for `browserVersion` and `platformName`).
2424
browserVersion: '' # Optional.
2525
platformName: '' # Optional.
26-
unsafeSsl: 'false' # Optional.
26+
unsafeSsl: false # Optional.
2727
activationThreshold: 0 # Optional.
2828
nodeMaxSessions: 1 # Optional.
29+
enableManagedDownloads: true # Optional.
2930
capabilities: '' # Optional.
3031
```
3132
@@ -39,7 +40,7 @@ triggers:
3940
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
4041
- `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)
4142
- `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).
42-
- `enableManagedDownloads`- Set this for Node enabled to auto manage files downloaded for a given session on the Node. When the client requests enabling this feature, it can only be assigned to the Node that also enabled it. Otherwise, the request will wait until it timed out. (Default: `false`, Optional).
43+
- `enableManagedDownloads`- Set this for Node enabled to auto manage files downloaded for a given session on the Node. When the client requests enabling this feature, it can only be assigned to the Node that also enabled it. Otherwise, the request will wait until it timed out. (Default: `true`, Optional).
4344
- `capabilities` - Add more custom capabilities for matching specific Nodes. It should be in JSON string, see [example](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes) (Optional)
4445

4546
**Trigger Authentication**

.keda/scalers/selenium_grid_scaler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type seleniumGridScalerMetadata struct {
4040
ActivationThreshold int64 `keda:"name=activationThreshold, order=triggerMetadata, optional"`
4141
UnsafeSsl bool `keda:"name=unsafeSsl, order=triggerMetadata, default=false"`
4242
NodeMaxSessions int64 `keda:"name=nodeMaxSessions, order=triggerMetadata, default=1"`
43-
EnableManagedDownloads bool `keda:"name=enableManagedDownloads, order=triggerMetadata, optional"`
43+
EnableManagedDownloads bool `keda:"name=enableManagedDownloads, order=triggerMetadata, default=true"`
4444
Capabilities string `keda:"name=capabilities, order=triggerMetadata, optional"`
4545

4646
TargetValue int64

.keda/scalers/selenium_grid_scaler_test.go

+144-131
Original file line numberDiff line numberDiff line change
@@ -3207,14 +3207,15 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
32073207
},
32083208
wantErr: false,
32093209
want: &seleniumGridScalerMetadata{
3210-
URL: "http://selenium-hub:4444/graphql",
3211-
BrowserName: "chrome",
3212-
SessionBrowserName: "chrome",
3213-
TargetValue: 1,
3214-
BrowserVersion: "",
3215-
PlatformName: "",
3216-
NodeMaxSessions: 1,
3217-
Capabilities: "",
3210+
URL: "http://selenium-hub:4444/graphql",
3211+
BrowserName: "chrome",
3212+
SessionBrowserName: "chrome",
3213+
TargetValue: 1,
3214+
BrowserVersion: "",
3215+
PlatformName: "",
3216+
NodeMaxSessions: 1,
3217+
EnableManagedDownloads: true,
3218+
Capabilities: "",
32183219
},
32193220
},
32203221
{
@@ -3230,14 +3231,15 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
32303231
},
32313232
wantErr: false,
32323233
want: &seleniumGridScalerMetadata{
3233-
URL: "http://selenium-hub:4444/graphql",
3234-
BrowserName: "MicrosoftEdge",
3235-
SessionBrowserName: "msedge",
3236-
TargetValue: 1,
3237-
BrowserVersion: "",
3238-
PlatformName: "",
3239-
NodeMaxSessions: 1,
3240-
Capabilities: "",
3234+
URL: "http://selenium-hub:4444/graphql",
3235+
BrowserName: "MicrosoftEdge",
3236+
SessionBrowserName: "msedge",
3237+
TargetValue: 1,
3238+
BrowserVersion: "",
3239+
PlatformName: "",
3240+
NodeMaxSessions: 1,
3241+
EnableManagedDownloads: true,
3242+
Capabilities: "",
32413243
},
32423244
},
32433245
{
@@ -3252,14 +3254,15 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
32523254
},
32533255
wantErr: false,
32543256
want: &seleniumGridScalerMetadata{
3255-
URL: "http://selenium-hub:4444/graphql",
3256-
BrowserName: "",
3257-
SessionBrowserName: "",
3258-
TargetValue: 1,
3259-
BrowserVersion: "",
3260-
PlatformName: "",
3261-
NodeMaxSessions: 1,
3262-
Capabilities: "",
3257+
URL: "http://selenium-hub:4444/graphql",
3258+
BrowserName: "",
3259+
SessionBrowserName: "",
3260+
TargetValue: 1,
3261+
BrowserVersion: "",
3262+
PlatformName: "",
3263+
NodeMaxSessions: 1,
3264+
EnableManagedDownloads: true,
3265+
Capabilities: "",
32633266
},
32643267
},
32653268
{
@@ -3279,16 +3282,17 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
32793282
},
32803283
wantErr: false,
32813284
want: &seleniumGridScalerMetadata{
3282-
URL: "http://selenium-hub:4444/graphql",
3283-
Username: "user",
3284-
Password: "password",
3285-
BrowserName: "MicrosoftEdge",
3286-
SessionBrowserName: "msedge",
3287-
TargetValue: 1,
3288-
BrowserVersion: "",
3289-
PlatformName: "",
3290-
NodeMaxSessions: 1,
3291-
Capabilities: "",
3285+
URL: "http://selenium-hub:4444/graphql",
3286+
Username: "user",
3287+
Password: "password",
3288+
BrowserName: "MicrosoftEdge",
3289+
SessionBrowserName: "msedge",
3290+
TargetValue: 1,
3291+
BrowserVersion: "",
3292+
PlatformName: "",
3293+
NodeMaxSessions: 1,
3294+
EnableManagedDownloads: true,
3295+
Capabilities: "",
32923296
},
32933297
},
32943298
{
@@ -3308,16 +3312,17 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
33083312
},
33093313
wantErr: false,
33103314
want: &seleniumGridScalerMetadata{
3311-
URL: "http://selenium-hub:4444/graphql",
3312-
BrowserName: "MicrosoftEdge",
3313-
SessionBrowserName: "msedge",
3314-
TargetValue: 1,
3315-
BrowserVersion: "",
3316-
PlatformName: "",
3317-
Username: "username",
3318-
Password: "password",
3319-
NodeMaxSessions: 1,
3320-
Capabilities: "",
3315+
URL: "http://selenium-hub:4444/graphql",
3316+
BrowserName: "MicrosoftEdge",
3317+
SessionBrowserName: "msedge",
3318+
TargetValue: 1,
3319+
BrowserVersion: "",
3320+
PlatformName: "",
3321+
Username: "username",
3322+
Password: "password",
3323+
NodeMaxSessions: 1,
3324+
EnableManagedDownloads: true,
3325+
Capabilities: "",
33213326
},
33223327
},
33233328
{
@@ -3366,15 +3371,16 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
33663371
},
33673372
wantErr: false,
33683373
want: &seleniumGridScalerMetadata{
3369-
URL: "http://selenium-hub:4444/graphql",
3370-
BrowserName: "chrome",
3371-
SessionBrowserName: "chrome",
3372-
TargetValue: 1,
3373-
BrowserVersion: "91.0",
3374-
UnsafeSsl: false,
3375-
PlatformName: "",
3376-
NodeMaxSessions: 1,
3377-
Capabilities: "",
3374+
URL: "http://selenium-hub:4444/graphql",
3375+
BrowserName: "chrome",
3376+
SessionBrowserName: "chrome",
3377+
TargetValue: 1,
3378+
BrowserVersion: "91.0",
3379+
UnsafeSsl: false,
3380+
PlatformName: "",
3381+
NodeMaxSessions: 1,
3382+
EnableManagedDownloads: true,
3383+
Capabilities: "",
33783384
},
33793385
},
33803386
{
@@ -3392,16 +3398,17 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
33923398
},
33933399
wantErr: false,
33943400
want: &seleniumGridScalerMetadata{
3395-
URL: "http://selenium-hub:4444/graphql",
3396-
BrowserName: "chrome",
3397-
SessionBrowserName: "chrome",
3398-
TargetValue: 1,
3399-
ActivationThreshold: 10,
3400-
BrowserVersion: "91.0",
3401-
UnsafeSsl: true,
3402-
PlatformName: "",
3403-
NodeMaxSessions: 1,
3404-
Capabilities: "",
3401+
URL: "http://selenium-hub:4444/graphql",
3402+
BrowserName: "chrome",
3403+
SessionBrowserName: "chrome",
3404+
TargetValue: 1,
3405+
ActivationThreshold: 10,
3406+
BrowserVersion: "91.0",
3407+
UnsafeSsl: true,
3408+
PlatformName: "",
3409+
NodeMaxSessions: 1,
3410+
EnableManagedDownloads: true,
3411+
Capabilities: "",
34053412
},
34063413
},
34073414
{
@@ -3434,16 +3441,17 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
34343441
},
34353442
wantErr: false,
34363443
want: &seleniumGridScalerMetadata{
3437-
URL: "http://selenium-hub:4444/graphql",
3438-
BrowserName: "chrome",
3439-
SessionBrowserName: "chrome",
3440-
TargetValue: 1,
3441-
ActivationThreshold: 10,
3442-
BrowserVersion: "91.0",
3443-
UnsafeSsl: true,
3444-
PlatformName: "",
3445-
NodeMaxSessions: 1,
3446-
Capabilities: "",
3444+
URL: "http://selenium-hub:4444/graphql",
3445+
BrowserName: "chrome",
3446+
SessionBrowserName: "chrome",
3447+
TargetValue: 1,
3448+
ActivationThreshold: 10,
3449+
BrowserVersion: "91.0",
3450+
UnsafeSsl: true,
3451+
PlatformName: "",
3452+
NodeMaxSessions: 1,
3453+
EnableManagedDownloads: true,
3454+
Capabilities: "",
34473455
},
34483456
},
34493457
{
@@ -3462,16 +3470,17 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
34623470
},
34633471
wantErr: false,
34643472
want: &seleniumGridScalerMetadata{
3465-
URL: "http://selenium-hub:4444/graphql",
3466-
BrowserName: "chrome",
3467-
SessionBrowserName: "chrome",
3468-
TargetValue: 1,
3469-
ActivationThreshold: 10,
3470-
BrowserVersion: "91.0",
3471-
UnsafeSsl: true,
3472-
PlatformName: "Windows 11",
3473-
NodeMaxSessions: 1,
3474-
Capabilities: "",
3473+
URL: "http://selenium-hub:4444/graphql",
3474+
BrowserName: "chrome",
3475+
SessionBrowserName: "chrome",
3476+
TargetValue: 1,
3477+
ActivationThreshold: 10,
3478+
BrowserVersion: "91.0",
3479+
UnsafeSsl: true,
3480+
PlatformName: "Windows 11",
3481+
NodeMaxSessions: 1,
3482+
EnableManagedDownloads: true,
3483+
Capabilities: "",
34753484
},
34763485
},
34773486
{
@@ -3495,18 +3504,19 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
34953504
},
34963505
wantErr: false,
34973506
want: &seleniumGridScalerMetadata{
3498-
URL: "http://selenium-hub:4444/graphql",
3499-
Username: "user",
3500-
Password: "password",
3501-
BrowserName: "chrome",
3502-
SessionBrowserName: "chrome",
3503-
TargetValue: 1,
3504-
ActivationThreshold: 10,
3505-
BrowserVersion: "91.0",
3506-
UnsafeSsl: true,
3507-
PlatformName: "Windows 11",
3508-
NodeMaxSessions: 3,
3509-
Capabilities: "",
3507+
URL: "http://selenium-hub:4444/graphql",
3508+
Username: "user",
3509+
Password: "password",
3510+
BrowserName: "chrome",
3511+
SessionBrowserName: "chrome",
3512+
TargetValue: 1,
3513+
ActivationThreshold: 10,
3514+
BrowserVersion: "91.0",
3515+
UnsafeSsl: true,
3516+
PlatformName: "Windows 11",
3517+
NodeMaxSessions: 3,
3518+
EnableManagedDownloads: true,
3519+
Capabilities: "",
35103520
},
35113521
},
35123522
{
@@ -3531,18 +3541,19 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
35313541
},
35323542
wantErr: false,
35333543
want: &seleniumGridScalerMetadata{
3534-
URL: "http://selenium-hub:4444/graphql",
3535-
Username: "user",
3536-
Password: "password",
3537-
BrowserName: "chrome",
3538-
SessionBrowserName: "chrome",
3539-
TargetValue: 1,
3540-
ActivationThreshold: 10,
3541-
BrowserVersion: "91.0",
3542-
UnsafeSsl: true,
3543-
PlatformName: "Windows 11",
3544-
NodeMaxSessions: 3,
3545-
Capabilities: "",
3544+
URL: "http://selenium-hub:4444/graphql",
3545+
Username: "user",
3546+
Password: "password",
3547+
BrowserName: "chrome",
3548+
SessionBrowserName: "chrome",
3549+
TargetValue: 1,
3550+
ActivationThreshold: 10,
3551+
BrowserVersion: "91.0",
3552+
UnsafeSsl: true,
3553+
PlatformName: "Windows 11",
3554+
NodeMaxSessions: 3,
3555+
EnableManagedDownloads: true,
3556+
Capabilities: "",
35463557
},
35473558
},
35483559
{
@@ -3567,18 +3578,19 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
35673578
},
35683579
wantErr: false,
35693580
want: &seleniumGridScalerMetadata{
3570-
URL: "http://selenium-hub:4444/graphql",
3571-
AuthType: "OAuth2",
3572-
AccessToken: "my-access-token",
3573-
BrowserName: "chrome",
3574-
SessionBrowserName: "chrome",
3575-
TargetValue: 1,
3576-
ActivationThreshold: 10,
3577-
BrowserVersion: "91.0",
3578-
UnsafeSsl: true,
3579-
PlatformName: "Windows 11",
3580-
NodeMaxSessions: 3,
3581-
Capabilities: "",
3581+
URL: "http://selenium-hub:4444/graphql",
3582+
AuthType: "OAuth2",
3583+
AccessToken: "my-access-token",
3584+
BrowserName: "chrome",
3585+
SessionBrowserName: "chrome",
3586+
TargetValue: 1,
3587+
ActivationThreshold: 10,
3588+
BrowserVersion: "91.0",
3589+
UnsafeSsl: true,
3590+
PlatformName: "Windows 11",
3591+
NodeMaxSessions: 3,
3592+
EnableManagedDownloads: true,
3593+
Capabilities: "",
35823594
},
35833595
},
35843596
{
@@ -3602,18 +3614,19 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
36023614
},
36033615
wantErr: false,
36043616
want: &seleniumGridScalerMetadata{
3605-
URL: "http://selenium-hub:4444/graphql",
3606-
AuthType: "Bearer",
3607-
AccessToken: "my-access-token",
3608-
BrowserName: "chrome",
3609-
SessionBrowserName: "chrome",
3610-
TargetValue: 1,
3611-
ActivationThreshold: 10,
3612-
BrowserVersion: "91.0",
3613-
UnsafeSsl: true,
3614-
PlatformName: "Windows 11",
3615-
NodeMaxSessions: 3,
3616-
Capabilities: "",
3617+
URL: "http://selenium-hub:4444/graphql",
3618+
AuthType: "Bearer",
3619+
AccessToken: "my-access-token",
3620+
BrowserName: "chrome",
3621+
SessionBrowserName: "chrome",
3622+
TargetValue: 1,
3623+
ActivationThreshold: 10,
3624+
BrowserVersion: "91.0",
3625+
UnsafeSsl: true,
3626+
PlatformName: "Windows 11",
3627+
NodeMaxSessions: 3,
3628+
EnableManagedDownloads: true,
3629+
Capabilities: "",
36173630
},
36183631
},
36193632
}

0 commit comments

Comments
 (0)