Skip to content

Commit

Permalink
fix(chart): upload.conf is missing in volumeMounts
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed May 14, 2024
1 parent 84a8e91 commit 62ea271
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/selenium-grid/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.30.1
version: 0.30.2
appVersion: 4.20.0-20240505
icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ template:
name: {{ template "seleniumGrid.recorder.configmap.fullname" $ }}
- configMapRef:
name: {{ template "seleniumGrid.server.configmap.fullname" $ }}
{{- if and $.Values.videoRecorder.uploader.enabled (not (empty $.Values.videoRecorder.uploader.name)) }}
{{- if and $.Values.videoRecorder.uploader.enabled (empty $.Values.videoRecorder.uploader.name) }}
- secretRef:
name: {{ tpl (default (include "seleniumGrid.common.secrets.fullname" $) $.Values.uploaderConfigMap.secretVolumeMountName) $ }}
{{- end }}
Expand Down Expand Up @@ -647,7 +647,7 @@ Define terminationGracePeriodSeconds of the node pod.
mountPath: {{ $.Values.recorderConfigMap.extraScriptsDirectory }}/{{ $fileName }}
subPath: {{ $fileName }}
{{- end }}
{{- if and $.Values.videoRecorder.uploader.enabled (not (empty $.Values.videoRecorder.uploader.name)) }}
{{- if and $.Values.videoRecorder.uploader.enabled (empty $.Values.videoRecorder.uploader.name) }}
{{- range $fileName, $value := .Values.uploaderConfigMap.secretFiles }}
- name: {{ tpl (default (include "seleniumGrid.common.secrets.fullname" $) $.Values.uploaderConfigMap.secretVolumeMountName) $ }}
mountPath: {{ $.Values.uploaderConfigMap.extraScriptsDirectory }}/{{ $fileName }}
Expand Down
25 changes: 25 additions & 0 deletions tests/charts/templates/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,31 @@ def test_extra_script_import_to_recorder_configmap(self):
count += 1
self.assertEqual(count, len(resources_name), "No recorder config resources found")

def test_upload_conf_mount_to_video_container(self):
resources_name = ['{0}selenium-chrome-node'.format(RELEASE_NAME),
'{0}selenium-edge-node'.format(RELEASE_NAME),
'{0}selenium-firefox-node'.format(RELEASE_NAME),]
is_present = False
for doc in LIST_OF_DOCUMENTS:
if doc['metadata']['name'] in resources_name and doc['kind'] == 'Deployment':
logger.info(f"Assert upload config is mounted to the container")
video_container = None
uploader_container = None
for container in doc['spec']['template']['spec']['containers']:
if container['name'] == 'video':
video_container = container
if container['name'] == 'uploader':
uploader_container = container
list_volume_mounts = None
if uploader_container is not None:
list_volume_mounts = uploader_container['volumeMounts']
else:
list_volume_mounts = video_container['volumeMounts']
for volume in list_volume_mounts:
if volume['mountPath'] == '/opt/bin/upload.conf':
is_present = True
self.assertTrue(is_present, "Volume mount for upload config is not present in the container")

def test_terminationGracePeriodSeconds_in_deployment_autoscaling(self):
resources_name = ['{0}selenium-chrome-node'.format(RELEASE_NAME),]
count = 0
Expand Down

0 comments on commit 62ea271

Please sign in to comment.