Skip to content

Commit fe80aba

Browse files
authored
Improve default value for videoRecorder in chart (#1984)
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent 0f7367e commit fe80aba

9 files changed

+19
-14
lines changed

charts/selenium-grid/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ template:
181181
imagePullPolicy: {{ .Values.videoRecorder.imagePullPolicy }}
182182
env:
183183
- name: UPLOAD_DESTINATION_PREFIX
184-
value: {{ .Values.videoRecorder.uploadDestinationPrefix }}
184+
value: {{ .Values.videoRecorder.uploadDestinationPrefix | quote }}
185185
{{- with .Values.videoRecorder.extraEnvironmentVariables }}
186186
{{- tpl (toYaml .) $ | nindent 8 }}
187187
{{- end }}

charts/selenium-grid/templates/chrome-node-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ spec:
2525
{{- $podScope := deepCopy . -}}
2626
{{- $_ := set $podScope "name" "selenium-chrome-node" -}}
2727
{{- $_ = set $podScope "node" .Values.chromeNode -}}
28-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
28+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
2929
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
3030
{{- end }}

charts/selenium-grid/templates/chrome-node-scaledjobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ spec:
3535
{{- $podScope := deepCopy . -}}
3636
{{- $_ := set $podScope "name" "selenium-chrome-node" -}}
3737
{{- $_ = set $podScope "node" .Values.chromeNode -}}
38-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
38+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
3939
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
4040
{{- end }}

charts/selenium-grid/templates/edge-node-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ spec:
2525
{{- $podScope := deepCopy . -}}
2626
{{- $_ := set $podScope "name" "selenium-edge-node" -}}
2727
{{- $_ = set $podScope "node" .Values.edgeNode -}}
28-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
28+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
2929
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
3030
{{- end }}

charts/selenium-grid/templates/edge-node-scaledjob.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ spec:
3535
{{- $podScope := deepCopy . -}}
3636
{{- $_ := set $podScope "name" "selenium-edge-node" -}}
3737
{{- $_ = set $podScope "node" .Values.edgeNode -}}
38-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
38+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
3939
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
4040
{{- end }}

charts/selenium-grid/templates/firefox-node-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ spec:
2525
{{- $podScope := deepCopy . -}}
2626
{{- $_ := set $podScope "name" "selenium-firefox-node" -}}
2727
{{- $_ = set $podScope "node" .Values.firefoxNode -}}
28-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
28+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
2929
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
3030
{{- end }}

charts/selenium-grid/templates/firefox-node-scaledjob.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ spec:
3535
{{- $podScope := deepCopy . -}}
3636
{{- $_ := set $podScope "name" "selenium-firefox-node" -}}
3737
{{- $_ = set $podScope "node" .Values.firefoxNode -}}
38-
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
38+
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
3939
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
4040
{{- end }}

charts/selenium-grid/templates/video-cm.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ data:
6767
if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]]
6868
then
6969
video_file_name="$session_id.mp4"
70-
video_file="${VIDEO_LOCATION:-/videos}/$video_file_name"
70+
video_file="${SE_VIDEO_FOLDER:-/videos}/$video_file_name"
7171
echo "Starting to record video"
7272
ffmpeg -nostdin -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p $video_file &
7373
recording_started="true"
@@ -77,9 +77,12 @@ data:
7777
echo "Stopping to record video"
7878
kill -INT %1
7979
fg || echo ffmpeg exited with code $?
80-
upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name}
81-
echo "Uploading video to $upload_destination"
82-
echo $video_file $upload_destination > /videos/uploadpipe &
80+
if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]
81+
then
82+
upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name}
83+
echo "Uploading video to $upload_destination"
84+
echo $video_file $upload_destination > /videos/uploadpipe &
85+
fi
8386
recording_started="false"
8487
elif [[ $recording_started = "true" ]]
8588
then

charts/selenium-grid/values.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,10 @@ videoRecorder:
730730
imageName: selenium/video
731731
enabled: false
732732
# Where to upload the video file. Should be set to something like 's3://myvideobucket/'
733-
uploadDestinationPrefix: ""
733+
uploadDestinationPrefix: false
734734
# What uploader to use. See .videRecorder.s3 for how to create a new one.
735-
uploader: s3
735+
# uploader: s3
736+
uploader: false
736737

737738
# Image of video recorder
738739
imageTag: latest
@@ -749,7 +750,7 @@ videoRecorder:
749750
memory: "1Gi"
750751
cpu: "1"
751752
extraEnvironmentVariables: []
752-
# - name: VIDEO_LOCATION
753+
# - name: SE_VIDEO_FOLDER
753754
# value: /videos
754755
# Custom environment variables by sourcing entire configMap, Secret, etc. for video recorder.
755756
extraEnvFrom:
@@ -761,6 +762,7 @@ videoRecorder:
761762
terminationGracePeriodSeconds: 30
762763
volume:
763764
emptyDir: {}
765+
# Container spec for the uploader if above it is defined as "uploader: s3"
764766
s3:
765767
imageName: public.ecr.aws/bitnami/aws-cli
766768
imageTag: "2"

0 commit comments

Comments
 (0)