-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Terminal Tooling depends on injecting kubeconfig into the first available container #258
Closed
Comments
A more isolated test: using the current master branch and the Works: kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
name: web-terminal
annotations:
controller.devfile.io/restricted-access: "true"
labels:
# it's a label OpenShift console uses a flag to mark terminal's workspaces
console.openshift.io/terminal: "true"
spec:
started: true
routingClass: 'web-terminal'
template:
components:
# TODO: Remove once defaulting for web terminal is implemented.
- name: dev
container:
image: quay.io/wto/web-terminal-tooling:latest
mountSources: false
memoryLimit: 256Mi
args: ["tail", "-f", "/dev/null"]
env:
- value: '\[\e[34m\]>\[\e[m\]\[\e[33m\]>\[\e[m\]'
name: PS1
- name: web-terminal
container:
image: quay.io/eclipse/che-machine-exec:nightly
mountSources: false
command: ["/go/bin/che-machine-exec",
"--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)",
"--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)",
"--pod-selector", "controller.devfile.io/workspace_id=$(CHE_WORKSPACE_ID)",
"--use-bearer-token",
"--use-tls"]
endpoints:
- name: web-terminal
targetPort: 4444
attributes:
protocol: http
type: ide
discoverable: "false"
secure: "true"
cookiesAuthEnabled: "true"
env:
- name: USE_BEARER_TOKEN
value: "true" Does not work: kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
name: web-terminal
annotations:
controller.devfile.io/restricted-access: "true"
labels:
# it's a label OpenShift console uses a flag to mark terminal's workspaces
console.openshift.io/terminal: "true"
spec:
started: true
routingClass: 'web-terminal'
template:
components:
- name: web-terminal
container:
image: quay.io/eclipse/che-machine-exec:nightly
mountSources: false
command: ["/go/bin/che-machine-exec",
"--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)",
"--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)",
"--pod-selector", "controller.devfile.io/workspace_id=$(CHE_WORKSPACE_ID)",
"--use-bearer-token",
"--use-tls"]
endpoints:
- name: web-terminal
targetPort: 4444
attributes:
protocol: http
type: ide
discoverable: "false"
secure: "true"
cookiesAuthEnabled: "true"
env:
- name: USE_BEARER_TOKEN
value: "true"
# TODO: Remove once defaulting for web terminal is implemented.
- name: dev
container:
image: quay.io/wto/web-terminal-tooling:latest
mountSources: false
memoryLimit: 256Mi
args: ["tail", "-f", "/dev/null"]
env:
- value: '\[\e[34m\]>\[\e[m\]\[\e[33m\]>\[\e[m\]'
name: PS1 |
23 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The Web Terminal Tooling plugin handles
/exec/init
calls by attempting to inject kubeconfig into the first container in the pod. If this fails, the whole call fails, so the plugin only works when the tooling container is first in the list.However, the devfile/api functions for merging plugin components into a devworkspace merge components in the order 1. Parent, 2. Plugins, 3. Main content, resulting in the tooling container being last in the list. This causes web terminal to fail with changes from #240
Short-term solution
The web terminal should resolve the first compatible container (i.e. if it can't resolve an exec in the first container, it should try the second, etc.)
Long-term solution
We need a way of specifying where web terminal should inject kubeconfig.
The text was updated successfully, but these errors were encountered: