Skip to content

Commit 2adc4a2

Browse files
committed
chart(fix): trim trailing slash in sub path
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 114d008 commit 2adc4a2

File tree

9 files changed

+27
-9
lines changed

9 files changed

+27
-9
lines changed

Diff for: .github/workflows/docker-test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ jobs:
7979
- name: Checkout code
8080
uses: actions/checkout@main
8181
- name: Set up containerd image store feature
82-
if: matrix.test-strategy != 'test_node_relay'
8382
uses: nick-invision/retry@master
8483
with:
8584
timeout_minutes: 10

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),
1212
NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME))
1313
AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ)
1414
PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false)
15-
FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS)
15+
FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS) --sbom=true --attest type=provenance,mode=max
1616
BUILD_ARGS := $(BUILD_ARGS)
1717
MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION)))
1818
MINOR := $(word 2,$(subst ., ,$(TAG_VERSION)))
@@ -75,7 +75,7 @@ gen_certs:
7575
./Base/certs/gen-cert-helper.sh -d ./Base/certs
7676

7777
base: prepare_resources gen_certs
78-
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) .
78+
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) .
7979

8080
base_nightly:
8181
BASE_VERSION=$(BASE_VERSION_NIGHTLY) BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) make base

Diff for: charts/selenium-grid/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: selenium-grid
33
description: A Helm chart for creating a Selenium Grid Server in Kubernetes
44
type: application
5-
version: 0.34.2
5+
version: 0.34.3
66
appVersion: 4.23.1-20240820
77
icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png
88
dependencies:
@@ -19,7 +19,7 @@ dependencies:
1919
name: jaeger
2020
condition: tracing.enabled, jaeger.enabled
2121
- repository: https://prometheus-community.github.io/helm-charts
22-
version: 62.0.0
22+
version: 62.1.0
2323
name: kube-prometheus-stack
2424
condition: monitoring.enabled, prometheus-stack.enabled
2525
maintainers:

Diff for: charts/selenium-grid/templates/_helpers.tpl

+9
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ Graphql Url of the hub or the router
667667
{{- else -}}
668668
{{- $subPath = default $subPath $.Values.hub.subPath -}}
669669
{{- end -}}
670+
{{- $subPath = include "utils.trimTrailingSlash" $subPath -}}
670671
{{- $subPath }}
671672
{{- end -}}
672673

@@ -823,6 +824,14 @@ Define terminationGracePeriodSeconds of the node pod.
823824
{{- not (empty $videoVolumes) | ternary $videoVolumes "" -}}
824825
{{- end -}}
825826

827+
{{- define "utils.trimTrailingSlash" -}}
828+
{{- $path := . -}}
829+
{{- if hasSuffix "/" $path -}}
830+
{{- $path = trimSuffix "/" $path -}}
831+
{{- end -}}
832+
{{- $path -}}
833+
{{- end -}}
834+
826835
{{/*
827836
Is used to append default items needed to an array if they are not already present. Args: currentArray, defaultArray, uniqueKey
828837
Usage: {{- $thisArray = include "utils.appendDefaultIfNotExist" (dict "currentArray" $thisArray "defaultArray" $defaultArray "uniqueKey" $uniqueKey }}

Diff for: charts/selenium-grid/templates/hub-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ spec:
110110
value: {{ .Values.hub.port | quote }}
111111
{{- with .Values.hub.subPath }}
112112
- name: SE_SUB_PATH
113-
value: {{ . | quote }}
113+
value: {{ include "utils.trimTrailingSlash" . | quote }}
114114
{{- end }}
115115
{{- if .Values.hub.disableUI }}
116116
- name: SE_DISABLE_UI

Diff for: charts/selenium-grid/templates/router-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
value: {{ .Values.components.sessionQueue.port | quote }}
6060
{{- with .Values.components.subPath }}
6161
- name: SE_SUB_PATH
62-
value: {{ . | quote }}
62+
value: {{ include "utils.trimTrailingSlash" . | quote }}
6363
{{- end }}
6464
{{- if .Values.components.router.disableUI }}
6565
- name: SE_DISABLE_UI

Diff for: tests/charts/templates/render/dummy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ingress:
3535
annotations: # Add you own annotations
3636
nginx.ingress.kubernetes.io/use-regex: "true" # Add new key
3737
nginx.ingress.kubernetes.io/rewrite-target: /$2
38-
nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium"
38+
nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium/"
3939
nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # Override default key
4040
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # Override default key
4141
hostname: ""

Diff for: tests/charts/templates/render/dummy_solution.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ selenium-grid:
3636
annotations: # Add you own annotations
3737
nginx.ingress.kubernetes.io/use-regex: "true" # Add new key
3838
nginx.ingress.kubernetes.io/rewrite-target: /$2
39-
nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium"
39+
nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium/"
4040
nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # Override default key
4141
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # Override default key
4242
hostname: ""

Diff for: tests/charts/templates/test.py

+10
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ def test_sub_path_set_to_grid_env_var(self):
7373
is_present = True
7474
self.assertTrue(is_present, "ENV variable SE_SUB_PATH is not populated")
7575

76+
def test_graphql_url_for_autoscaling_constructed_correctly(self):
77+
resources_name = ['{0}selenium-chrome-node'.format(RELEASE_NAME),]
78+
count = 0
79+
for doc in LIST_OF_DOCUMENTS:
80+
if doc['metadata']['name'] in resources_name and doc['kind'] == 'ScaledObject':
81+
logger.info(f"Assert trigger url is set GraphQL endpoint in resource {doc['metadata']['name']}")
82+
self.assertTrue(doc['spec']['triggers'][0]['metadata']['url'] == 'https://sysadmin:strongPassword@{0}selenium-router.default:4444/selenium/graphql'.format(RELEASE_NAME))
83+
count += 1
84+
self.assertEqual(count, len(resources_name), "GraphQL endpoint is not set correctly")
85+
7686
def test_distributor_new_session_thread_pool_size(self):
7787
resources_name = ['{0}selenium-distributor'.format(RELEASE_NAME)]
7888
is_present = False

0 commit comments

Comments
 (0)