intellij-kubernetes
intellij-kubernetes copied to clipboard
freshly created RH sandbox: editor errors when pushing yaml for pod without namespace
Steps:
- ASSERT: make sure you have a freshly created RH sandbox and are logged in as developer (you'd notice that there are no namespaces/projects yet)
- EXEC: open an editor with the following content (pod without namespace):
---
apiVersion: "v1"
kind: "Pod"
metadata:
name: "countdown"
spec:
containers:
- command:
- "bin/bash"
- "-c"
- "for i in 9 8 7 6 5 4 3 2 1 ; do echo $i ; done"
image: "centos:7"
imagePullPolicy: "IfNotPresent"
name: "counter"
resources: {}
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
volumeMounts:
- mountPath: "/var/run/secrets/kubernetes.io/serviceaccount"
name: "default-token-8sft4"
readOnly: true
dnsPolicy: "ClusterFirst"
enableServiceLinks: true
nodeName: "knativetutorial"
preemptionPolicy: "PreemptLowerPriority"
priority: 0
restartPolicy: "Always"
schedulerName: "default-scheduler"
securityContext: {}
serviceAccount: "default"
serviceAccountName: "default"
terminationGracePeriodSeconds: 30
tolerations:
- effect: "NoExecute"
key: "node.kubernetes.io/not-ready"
operator: "Exists"
tolerationSeconds: 300
- effect: "NoExecute"
key: "node.kubernetes.io/unreachable"
operator: "Exists"
tolerationSeconds: 300
volumes:
- name: "default-token-8sft4"
secret:
defaultMode: 420
secretName: "default-token-8sft4"
- ASSERT: expected error: editor complains that it could not retrieve the pod on cluster
- EXEC: hit "push" button in the toolbar
Result:
Editor displays an error caused by the push. It is missing the required namespace.
The editor should have used the default namespace/project.
The push is successfull if you add the current namespace to the yaml.
The error also goes away once the sandbox has a current namespace/project. The issue only happens on freshly started/initialized sandboxes.
The only thing we could do here is to detect if the sandbox is lacking a current project/namespace and warn the user accordingly
This was fixed, can't replicate it any more. Closing.