Skip to content
This repository was archived by the owner on Jan 4, 2022. It is now read-only.

Commit fd9ca3d

Browse files
Daishan PengAlena Prokharchyk
authored andcommitted
add timeout option to rce
1 parent 9525fcb commit fd9ca3d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

code/implementation/docker/machine/src/main/java/io/cattle/platform/docker/machine/launch/ComposeExecutorLauncher.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import io.cattle.platform.service.launcher.GenericServiceLauncher;
1010
import io.cattle.platform.util.type.InitializationTask;
1111

12+
import java.util.ArrayList;
13+
import java.util.List;
1214
import java.util.Map;
1315

1416
import javax.inject.Inject;
@@ -20,6 +22,7 @@
2022
public class ComposeExecutorLauncher extends GenericServiceLauncher implements InitializationTask {
2123

2224
private static final DynamicStringProperty COMPOSE_EXECUTOR_BINARY = ArchaiusUtil.getString("compose.executor.service.executable");
25+
private static final DynamicStringProperty COMPOSE_EXECUTOR_CLIENT_TIMEOUT = ArchaiusUtil.getString("compose.executor.service.executable.timeout");
2326
private static final DynamicBooleanProperty LAUNCH_COMPOSE_EXECUTOR = ArchaiusUtil.getBoolean("compose.executor.execute");
2427

2528
@Inject
@@ -41,6 +44,7 @@ protected void setEnvironment(Map<String, String> env) {
4144
env.put("CATTLE_ACCESS_KEY", cred.getPublicValue());
4245
env.put("CATTLE_SECRET_KEY", cred.getSecretValue());
4346
env.put("CATTLE_URL", ServerContext.getLocalhostUrl(BaseProtocol.HTTP));
47+
env.put("RANCHER_CLIENT_TIMEOUT", COMPOSE_EXECUTOR_CLIENT_TIMEOUT.get());
4448
}
4549

4650
@Override
@@ -52,5 +56,12 @@ protected LockDefinition getLock() {
5256
protected boolean isReady() {
5357
return true;
5458
}
59+
60+
@Override
61+
protected List<DynamicStringProperty> getReloadSettings() {
62+
List<DynamicStringProperty> list = new ArrayList<>();
63+
list.add(COMPOSE_EXECUTOR_CLIENT_TIMEOUT);
64+
return list;
65+
}
5566

5667
}

code/packaging/app-config/src/main/resources/META-INF/cattle/process/defaults.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ machine.execute=false
9494
machine.driver.config=file:///var/lib/rancher/etc/machinedrivers.json
9595

9696
compose.executor.service.executable=rancher-compose-executor
97+
compose.executor.service.executable.timeout=0
9798
compose.executor.execute=false
9899

99100
catalog.service.executable=rancher-catalog-service

0 commit comments

Comments
 (0)