Skip to content

Commit

Permalink
[grid] Dynamic Grid is able to disable video container spawn up
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Jan 8, 2025
1 parent 7425162 commit 5302ad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public Map<Capabilities, Collection<SessionFactory>> getDockerSessionFactories(

loadImages(docker, kinds.keySet().toArray(new String[0]));
Image videoImage = getVideoImage(docker);
loadImages(docker, videoImage.getName());
if (videoImage != null) {
loadImages(docker, videoImage.getName());
}

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

private Image getVideoImage(Docker docker) {
String videoImage = config.get(DOCKER_SECTION, "video-image").orElse(DEFAULT_VIDEO_IMAGE);
if (videoImage.equalsIgnoreCase("false")) {
return null;
}
return docker.getImage(videoImage);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private void setCapsToEnvVars(

private Container startVideoContainer(
Capabilities sessionCapabilities, String browserContainerIp, String hostPath) {
if (!recordVideoForSession(sessionCapabilities)) {
if (videoImage == null || !recordVideoForSession(sessionCapabilities)) {
return null;
}
int videoPort = 9000;
Expand Down

0 comments on commit 5302ad4

Please sign in to comment.