abrochard / kubel

Emacs extension for controlling Kubernetes with limited permissions
GNU General Public License v3.0
259 stars 41 forks source link

Fix tramp-error Method 'kubectl' is not known. #89

Closed EdmondFrank closed 1 year ago

EdmondFrank commented 2 years ago

I encountered the same problem as #28, and solved it in this way.

abrochard commented 2 years ago

Thank you for submitting this! Would you be able to explain the reasoning behind this? Also this is failing in CI

Entering directory '/kubel/'
kubel.el:1253:1: warning: `eval-after-load' is for use in configurations, and should rarely be used in packages
EdmondFrank commented 2 years ago

Thank you for submitting this! Would you be able to explain the reasoning behind this? Also this is failing in CI

Entering directory '/kubel/'
kubel.el:1253:1: warning: `eval-after-load' is for use in configurations, and should rarely be used in packages

Thank you for your reply.

Would you be able to explain the reasoning behind this?

The reason may be that emacs will restore the recently opened buffer list when starts. If user had used kubel-exec-shell-pod before, there is a kubel related buffer in the recently opened list. After the buffer is restored, there will be a kubel buffer in the buffer list, but tramp-methods list does not contain the kubel method at this time.

Also this is failing in CI

Yes, as the ci description says, eval-after-load is more recommended in user config than in package, but I haven't found a better alternative either.