Skip to content

Commit 5619122

Browse files
authored
Merge pull request #875 from rushtehrani/fix/main-container
fix: Add ONEPANEL_MAIN_CONTAINER env var to all Workspaces
2 parents 4275c3c + bf9c20d commit 5619122

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

db/yaml/workspaces/jupyterlab/20210129142057.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ containers:
88
value: "'{'headers':{'Content-Security-Policy':\"frame-ancestors\ *\ 'self'\"}}'"
99
- name: TENSORBOARD_PROXY_URL
1010
value: '//$(ONEPANEL_RESOURCE_UID)--$(ONEPANEL_RESOURCE_NAMESPACE).$(ONEPANEL_DOMAIN)/tensorboard'
11+
- name: ONEPANEL_MAIN_CONTAINER
12+
value: 'true'
1113
ports:
1214
- containerPort: 8888
1315
name: jupyterlab

db/yaml/workspaces/vscode/20210129152427.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ containers:
22
- name: vscode
33
image: onepanel/vscode:1.0.0
44
command: ["/bin/bash", "-c", "pip install onepanel-sdk && /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 --auth none ."]
5+
env:
6+
- name: ONEPANEL_MAIN_CONTAINER
7+
value: 'true'
58
ports:
69
- containerPort: 8080
710
name: vscode

pkg/workspace.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,6 @@ func (c *Client) addRuntimeFieldsToWorkspaceTemplate(t wfv1.Template, workspace
315315
}
316316

317317
mainContainerIndex := -1
318-
if len(containers) == 2 {
319-
// It's 1 because we prepend the node capture container and we want the other container to be main
320-
mainContainerIndex = 1
321-
}
322-
323318
for i := range containers {
324319
container := containers[i]
325320

0 commit comments

Comments
 (0)