diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index cfc174425..7ea1aff74 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -79,7 +79,6 @@ jobs: - name: Checkout code uses: actions/checkout@main - name: Set up containerd image store feature - if: matrix.test-strategy != 'test_node_relay' uses: nick-invision/retry@master with: timeout_minutes: 10 diff --git a/Makefile b/Makefile index d1ac10ca9..2e2365876 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY), NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false) -FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS) +FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS) --sbom=true --attest type=provenance,mode=max BUILD_ARGS := $(BUILD_ARGS) MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION))) MINOR := $(word 2,$(subst ., ,$(TAG_VERSION))) @@ -75,7 +75,7 @@ gen_certs: ./Base/certs/gen-cert-helper.sh -d ./Base/certs base: prepare_resources gen_certs - cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/base:$(TAG_VERSION) . + cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) --build-arg AUTHORS=$(AUTHORS) --sbom=true --attest type=provenance,mode=max -t $(NAME)/base:$(TAG_VERSION) . base_nightly: BASE_VERSION=$(BASE_VERSION_NIGHTLY) BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) make base diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index b9ed3a3e7..20c0c4bc5 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.34.2 +version: 0.34.3 appVersion: 4.23.1-20240820 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: @@ -19,7 +19,7 @@ dependencies: name: jaeger condition: tracing.enabled, jaeger.enabled - repository: https://prometheus-community.github.io/helm-charts - version: 62.0.0 + version: 62.1.0 name: kube-prometheus-stack condition: monitoring.enabled, prometheus-stack.enabled maintainers: diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 5989c3f17..334035cb7 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -667,6 +667,7 @@ Graphql Url of the hub or the router {{- else -}} {{- $subPath = default $subPath $.Values.hub.subPath -}} {{- end -}} +{{- $subPath = include "utils.trimTrailingSlash" $subPath -}} {{- $subPath }} {{- end -}} @@ -823,6 +824,14 @@ Define terminationGracePeriodSeconds of the node pod. {{- not (empty $videoVolumes) | ternary $videoVolumes "" -}} {{- end -}} +{{- define "utils.trimTrailingSlash" -}} +{{- $path := . -}} +{{- if hasSuffix "/" $path -}} + {{- $path = trimSuffix "/" $path -}} +{{- end -}} +{{- $path -}} +{{- end -}} + {{/* Is used to append default items needed to an array if they are not already present. Args: currentArray, defaultArray, uniqueKey Usage: {{- $thisArray = include "utils.appendDefaultIfNotExist" (dict "currentArray" $thisArray "defaultArray" $defaultArray "uniqueKey" $uniqueKey }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 7219df3eb..31eb94e13 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -110,7 +110,7 @@ spec: value: {{ .Values.hub.port | quote }} {{- with .Values.hub.subPath }} - name: SE_SUB_PATH - value: {{ . | quote }} + value: {{ include "utils.trimTrailingSlash" . | quote }} {{- end }} {{- if .Values.hub.disableUI }} - name: SE_DISABLE_UI diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index bb08c2b07..5762fbafc 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -59,7 +59,7 @@ spec: value: {{ .Values.components.sessionQueue.port | quote }} {{- with .Values.components.subPath }} - name: SE_SUB_PATH - value: {{ . | quote }} + value: {{ include "utils.trimTrailingSlash" . | quote }} {{- end }} {{- if .Values.components.router.disableUI }} - name: SE_DISABLE_UI diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index f4952d4f4..78256b569 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -35,7 +35,7 @@ ingress: annotations: # Add you own annotations nginx.ingress.kubernetes.io/use-regex: "true" # Add new key nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium" + nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium/" nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # Override default key nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # Override default key hostname: "" diff --git a/tests/charts/templates/render/dummy_solution.yaml b/tests/charts/templates/render/dummy_solution.yaml index ca40d43a6..b15119c70 100644 --- a/tests/charts/templates/render/dummy_solution.yaml +++ b/tests/charts/templates/render/dummy_solution.yaml @@ -36,7 +36,7 @@ selenium-grid: annotations: # Add you own annotations nginx.ingress.kubernetes.io/use-regex: "true" # Add new key nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium" + nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium/" nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # Override default key nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # Override default key hostname: "" diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index 26344561c..84eb999b7 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -73,6 +73,16 @@ def test_sub_path_set_to_grid_env_var(self): is_present = True self.assertTrue(is_present, "ENV variable SE_SUB_PATH is not populated") + def test_graphql_url_for_autoscaling_constructed_correctly(self): + resources_name = ['{0}selenium-chrome-node'.format(RELEASE_NAME),] + count = 0 + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'ScaledObject': + logger.info(f"Assert trigger url is set GraphQL endpoint in resource {doc['metadata']['name']}") + self.assertTrue(doc['spec']['triggers'][0]['metadata']['url'] == 'https://sysadmin:strongPassword@{0}selenium-router.default:4444/selenium/graphql'.format(RELEASE_NAME)) + count += 1 + self.assertEqual(count, len(resources_name), "GraphQL endpoint is not set correctly") + def test_distributor_new_session_thread_pool_size(self): resources_name = ['{0}selenium-distributor'.format(RELEASE_NAME)] is_present = False