Skip to content

Commit 5302ad4

Browse files
committed
[grid] Dynamic Grid is able to disable video container spawn up
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 7425162 commit 5302ad4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

java/src/org/openqa/selenium/grid/node/docker/DockerOptions.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ public Map<Capabilities, Collection<SessionFactory>> getDockerSessionFactories(
159159

160160
loadImages(docker, kinds.keySet().toArray(new String[0]));
161161
Image videoImage = getVideoImage(docker);
162-
loadImages(docker, videoImage.getName());
162+
if (videoImage != null) {
163+
loadImages(docker, videoImage.getName());
164+
}
163165

164166
// Hard coding the config section value "node" to avoid an extra dependency
165167
int maxContainerCount =
@@ -224,6 +226,9 @@ protected List<Device> getDevicesMapping() {
224226

225227
private Image getVideoImage(Docker docker) {
226228
String videoImage = config.get(DOCKER_SECTION, "video-image").orElse(DEFAULT_VIDEO_IMAGE);
229+
if (videoImage.equalsIgnoreCase("false")) {
230+
return null;
231+
}
227232
return docker.getImage(videoImage);
228233
}
229234

java/src/org/openqa/selenium/grid/node/docker/DockerSessionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private void setCapsToEnvVars(
335335

336336
private Container startVideoContainer(
337337
Capabilities sessionCapabilities, String browserContainerIp, String hostPath) {
338-
if (!recordVideoForSession(sessionCapabilities)) {
338+
if (videoImage == null || !recordVideoForSession(sessionCapabilities)) {
339339
return null;
340340
}
341341
int videoPort = 9000;

0 commit comments

Comments
 (0)