Skip to content

Commit 373929d

Browse files
committed
Merge pull request '#27576: allow accessing apps of older instances' (#62) from feature/27576/access-old into develop
2 parents 432736b + 6462623 commit 373929d

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

kubernetesPod.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ spec:
1212
- name: containerproxy-build
1313
image: 196229073436.dkr.ecr.eu-west-1.amazonaws.com/openanalytics/containerproxy-build
1414
securityContext:
15-
privileged: true
15+
privileged: true
1616
command: ["sh"]
1717
args: ["/usr/src/app/docker-entrypoint.sh"]
1818
tty: true
1919
volumeMounts:
2020
- mountPath: ~/.m2
21-
name: maven-repo
21+
name: maven-repo
22+
resources:
23+
requests:
24+
memory: "2Gi"
25+
cpu: "1.0"
26+
limits:
27+
memory: "4Gi"
28+
cpu: "1.5"

src/main/java/eu/openanalytics/containerproxy/backend/AbstractContainerBackend.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public void initialize() throws ContainerProxyException {
120120

121121
@Override
122122
public SuccessOrFailure<Proxy> startProxy(Proxy proxy) throws ContainerProxyException {
123-
proxy.setId(UUID.randomUUID().toString());
124123
proxy.setStatus(ProxyStatus.Starting);
125124
proxy.setCreatedTimestamp(System.currentTimeMillis());
126125
setRuntimeValues(proxy);

src/main/java/eu/openanalytics/containerproxy/service/ProxyService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.List;
2929
import java.util.Map.Entry;
3030
import java.util.Set;
31+
import java.util.UUID;
3132
import java.util.concurrent.ExecutorService;
3233
import java.util.concurrent.Executors;
3334
import java.util.function.BiConsumer;
@@ -250,7 +251,7 @@ public List<Proxy> getProxiesOfCurrentUser(Predicate<Proxy> filter) {
250251
* @throws ContainerProxyException If the proxy fails to start for any reason.
251252
*/
252253
public Proxy startProxy(ProxySpec spec, boolean ignoreAccessControl) throws ContainerProxyException {
253-
return startProxy(spec, ignoreAccessControl, null);
254+
return startProxy(spec, ignoreAccessControl, null, UUID.randomUUID().toString());
254255
}
255256

256257
/**
@@ -262,12 +263,13 @@ public Proxy startProxy(ProxySpec spec, boolean ignoreAccessControl) throws Cont
262263
* @return The newly launched proxy.
263264
* @throws ContainerProxyException If the proxy fails to start for any reason.
264265
*/
265-
public Proxy startProxy(ProxySpec spec, boolean ignoreAccessControl, List<RuntimeValue> runtimeValues) throws ContainerProxyException {
266+
public Proxy startProxy(ProxySpec spec, boolean ignoreAccessControl, List<RuntimeValue> runtimeValues, String proxyId) throws ContainerProxyException {
266267
if (!ignoreAccessControl && !userService.canAccess(spec)) {
267268
throw new AccessDeniedException(String.format("Cannot start proxy %s: access denied", spec.getId()));
268269
}
269270

270271
Proxy proxy = new Proxy();
272+
proxy.setId(proxyId);
271273
proxy.setStatus(ProxyStatus.New);
272274
proxy.setUserId(userService.getCurrentUserId());
273275
proxy.setSpec(spec);

0 commit comments

Comments
 (0)