intellij-kubernetes icon indicating copy to clipboard operation
intellij-kubernetes copied to clipboard

freshly created RH sandbox: editor errors when pushing yaml for pod without namespace

Open adietish opened this issue 3 years ago • 1 comments

Steps:

  1. 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)
  2. 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"
  1. ASSERT: expected error: editor complains that it could not retrieve the pod on cluster
  2. EXEC: hit "push" button in the toolbar

Result: Editor displays an error caused by the push. It is missing the required namespace. grafik 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.

adietish avatar Aug 19 '22 15:08 adietish

The only thing we could do here is to detect if the sandbox is lacking a current project/namespace and warn the user accordingly

adietish avatar Aug 19 '22 15:08 adietish

This was fixed, can't replicate it any more. Closing.

adietish avatar Feb 07 '25 17:02 adietish