Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScaledObject with a trigger whose metadata browserVersion is latest is always being triggered regardless of the browserVersion requested by the user #4347

Closed
gifflet opened this issue Mar 9, 2023 · 1 comment · Fixed by #4348
Labels
bug Something isn't working

Comments

@gifflet
Copy link
Contributor

gifflet commented Mar 9, 2023

Report

ScaledObject with a trigger whose metadata browserVersion is latest is always being triggered regardless of the browserVersion requested by the user.

Considering that the following ScaledObjects have been defined with triggers in this way:

linux-chrome-105-scaledobject.yaml

  triggers:
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: '105.0'
        platformName: 'Linux'

linux-chrome-110-scaledobject.yaml

  triggers:
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: '110.0'
        platformName: 'Linux'
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: 'latest'
        platformName: 'Linux'

In the Selenium grid, when a session includes the following capabilities:

{
    "browserName": "chrome",
    "browserVersion": "105.0",
    "platformName": "linux"
}

It turns out that both ScaledObjects: linux-chrome-105-scaledobject and linux-chrome-110-scaledobject are being associated with the queued session in the Selenium grid.

Expected Behavior

The expected behavior is that only linux-chrome-105-scaledobject is triggered and associated with the queued session whose browserVersion capability is 105.0.

Actual Behavior

Both ScaledObjects: linux-chrome-105-scaledobject and linux-chrome-110-scaledobject are being associated with the queued session { "browserName": "chrome", "browserVersion": "105.0", "platformName": "linux"} in the Selenium grid.

Steps to Reproduce the Problem

  1. Define two ScaledObjects that represent different versions of a browser. Only one of them should have two triggers: the first one pointing to the specific version of the browser, and the second one set with browserVersion equal to latest.
  2. Run an automated test where the browserVersion value is not defined in any of the triggers of the ScaledObject that has latest as the browserVersion metadata in the defined capabilities.
  3. It is noticed that two pods are started almost at the same time: the pod associated with the deployment of linux-chrome-105-scaledobject and linux-chrome-110-scaledobject respectively.

Logs from KEDA operator

2023-03-09T16:01:13Z INFO scaleexecutor Successfully updated ScaleTarget {"scaledobject.Name": "linux-chrome-110-scaledobject", "scaledObject.Namespace": "selenium", "scaleTarget.Name": "linux-chrome-110", "Original Replicas Count": 0, "New Replicas Count": 1}
2023-03-09T16:01:16Z INFO scaleexecutor Successfully updated ScaleTarget {"scaledobject.Name": "linux-chrome-105-scaledobject", "scaledObject.Namespace": "selenium", "scaleTarget.Name": "linux-chrome-105", "Original Replicas Count": 0, "New Replicas Count": 1}

KEDA Version

2.9.3

Kubernetes Version

1.26

Platform

Any

Scaler Details

Selenium Grid Scaler

Anything else?

No response

@gifflet
Copy link
Contributor Author

gifflet commented Mar 9, 2023

Fix already available in #4348

@github-project-automation github-project-automation bot moved this from To Triage to Ready To Ship in Roadmap - KEDA Core Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant