-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Kubeconfig Format Corruption After Switching Clusters and Restarting Workspace #23238
Comments
Hello @eye0fra, could you please elaborate more on:
|
|
@eye0fra According to the error this is a formatting issue, can you provide the content of the |
@eye0fra Could you please provide the cluster's kubernetes version as well. |
It is yaml. |
|
@eye0fra Thank you for the response, but can you paste the real content of the kubeconfig file as a raw text. We might miss some formatting cases if we parse the image. |
@eye0fra sorry, I'm a bit late with follow up, but please clarify if you can reproduce the bug on workspaces.openshift.com? |
{
"apiVersion": "v1",
"kind": "Config",
"clusters": [
{
"name": "inCluster",
"cluster": {
"server": "https://100.65.0.1:443",
"certificate-authority": "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
"insecure-skip-tls-verify": false
}
}
],
"users": [
{
"name": "developer",
"user": {
"token": "sha256~xxxxx"
}
}
],
"contexts": [
{
"name": "logged-user",
"context": {
"user": "developer",
"cluster": "inCluster",
"name": "logged-user",
"namespace": "xxxxxxxx"
}
}
],
"preferences": {},
"current-context": "logged-user"
}
apiVersion: v1
clusters:
- cluster:
server: https://xxx:6443
name: xxx:6443
- cluster:
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
server: https://100.65.0.1:443
name: inCluster
contexts:
- context:
cluster: xxx/xxx:6443
namespace: xxx-d
user: xxx:6443
name: xxx:6443/xxx
- context:
cluster: inCluster
namespace: xxx-devspaces-d
user: developer
name: logged-user
current-context: xxx/xxx:6443/xxx
kind: Config
preferences: {}
users:
- name: xxx/xxx:6443
user:
token: sha256~xxx
- name: developer
user:
token: sha256~xxx
apiVersion: v1 clusters: - cluster: server: https://xxx:6443 name: xxx:6443 - cluster: certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt server: https://100.65.0.1:443 name: inCluster contexts: - context: cluster: xxx/xxx:6443 namespace: xxx-d user: xxx/xxx:6443 name: xxx/xxx:6443/xxx - context: cluster: inCluster namespace: xxx-devspaces-d user: developer name: logged-user current-context: xxx/xxx:6443/xxxx kind: Config preferences: {} users: - name: xxx/xxx:6443 user: token: sha256~xxxx - name: developer user: token: sha256~xxx |
The |
I managed to reproduce the issue by applying the Persistent user home option. After workspace restart the kube config file content formatting breaks. |
Describe the bug
Hello,
I've encountered an issue with Kubernetes context renewal/injection. Initially, the kubeconfig is in JSON format. However, when I use the oc command line to log into a different cluster for testing, the format switches to YAML.
Upon restarting the workspace, the injection process disrupts the YAML file, causing it to become a single inline entry. Consequently, the kubeconfig becomes unusable, affecting all related dependencies, such as kubedock.
The current workaround is to delete the kubeconfig and restart the workspace to restore the correct kubeconfig format.
Che version
7.94@latest
Steps to reproduce
Initial Setup:
kubeconfig
. (kubedock is working)Switch Cluster:
oc
command line tool to log into a different OpenShift cluster:kubeconfig
format changes to YAML.Restart Workspace:
Observe the Issue:
kubeconfig
file. It should now be a single inline YAML entry.kubedock
and observe failures due to the malformedkubeconfig
.Workaround:
kubeconfig
format.Expected behavior
The kubeconfig should maintain its format and functionality after switching context.
Runtime
OpenShift
Screenshots
Installation method
OperatorHub
Environment
other (please specify in additional context)
Eclipse Che Logs
No response
Additional context
OpenShift DevSpaces 3.16.1
The text was updated successfully, but these errors were encountered: