Skip to content
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

feat: impl'd describe for pods (#553) #770

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Jul 10, 2024

partially fixes #553: it only provides "describe" for pods, no other resource kind is supported. Support for these is filed at #782

How to test this:

This implementation should provide the same output as kubectl describe pod <name>.

Steps:

  1. EXEC: copy & paste the following into an editor in IJ, naming the file "describe-test.yml":
    https://gist.github.com/adietish/b9bde277776f657af7d76515effa1882#file-describe-test-yml. Then push the editor to the cluster.
    (alternatively you can also use kubectl with the file: kubectl apply -f describe-test.yml)
  2. ASSERT: a Pod describe-test is created and show up in the resource tree
  3. EXEC: pick "Describe" in the context menu to the pod describe-test ([cluster] > Workloads > Pods > describe-test)
  4. ASSERT: An editor is opened describing the pod. The title of the editor is "Describe Pod describe-test".
  5. EXEC: run kubectl describe pod describe-test and compare the output with the content of the editor

Comparing the outputs:
You can use a diff or https://www.diffchecker.com/text-compare/ which helps a lot.
There are limitations that were not implemented yet (ex. the list of events that kubectl is printing in the end of the output):

The following examples show equivalence in intellij-kubernetes and kubectl. The differences are mainly in formatting, cause by the fact the intellij-kubernetes is producing YAML whereas kubectl is simply printing text.

Examples:

  • kubectl
Labels:     luke=skywalker
            princess=leia
  • intellij-kubernetes (creates a yaml mapping, <key>:<value> instead of <key>=<value>)
Labels:
  luke: skywalker
  princess: leia
  • kubectl
Medium:
  • intellij-kubernetes (prints <none> instead of ``)
Medium: <none>
  • kubectl
Readiness Gates:
  Type                     Status
  www.example.com/gate-1   <none>
  ContainersReady          <none>
  • intellij-kubernetes (skips heading: "Type Status")
  www.example.com/gate-1: <none>
  ContainersReady: <none>
  • kubectl
Tolerations:    gpu=true:NoSchedule
                node.kubernetes.io/not-ready:NoExecute for 3600s
                node.kubernetes.io/unreachable:NoExecute op=Exists for 3600s
                project=system:NoSchedule
  • intellij-kuberetes (creates a yaml sequence, each element starts with -):
Tolerations:
- gpu=true:NoSchedule
- project=system:NoSchedule
- node.kubernetes.io/unreachable:NoExecute op=Exists for 3600s
- node.kubernetes.io/not-ready:NoExecute for 3600s
  • kubectl
Environment:
      MY_POD_NAME:             describe-test (v1:metadata.name)
Environment:
    MY_POD_NAME: (v1:metadata.name)

@adietish adietish self-assigned this Jul 10, 2024
@adietish adietish force-pushed the issue-553 branch 19 times, most recently from d0c9a23 to 8f7a6b7 Compare July 17, 2024 11:14
@adietish adietish force-pushed the issue-553 branch 9 times, most recently from 5e9b237 to b45481e Compare July 19, 2024 10:35
@adietish
Copy link
Collaborator Author

adietish commented Aug 7, 2024

@sbouchet I also changed Command to better match kubectl:

  • kubectl:
   Command:
      /kuberos
      https://accounts.google.com
      REDACTED.apps.googleusercontent.com
      /cfg/secret
      /cfg/template
  • intellij-kubernetes:
   Command: |-
      /kuberos
      https://accounts.google.com
      REDACTED.apps.googleusercontent.com
      /cfg/secret
      /cfg/template

@adietish adietish force-pushed the issue-553 branch 18 times, most recently from 27903b3 to 20dcf3e Compare August 8, 2024 11:07
@adietish
Copy link
Collaborator Author

adietish commented Aug 8, 2024

@sbouchet please re-review, thanks!

Copy link
Collaborator

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking copyrights. LGTM !

Copy link

sonarcloud bot commented Aug 9, 2024

@adietish adietish merged commit 911769e into redhat-developer:main Aug 9, 2024
13 checks passed
@adietish adietish deleted the issue-553 branch August 9, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide "describe" like in vscode
2 participants