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

Use of extensions? #1

Open
hugoideler opened this issue Feb 22, 2023 · 5 comments
Open

Use of extensions? #1

hugoideler opened this issue Feb 22, 2023 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@hugoideler
Copy link

Hi, thanks for creating the flatpak!

Has the flatpak also been tested with extensions? In particular, @alebcay/openlens-node-pod-menu?

I am finding that the installation of the extension is not successful. On the other hand, I've also tried an OpenLens AppImage, and there it works.

The error I get is:

info:    ▪ [EXTENSION-INSTALLER] installing package from /home/myusername/.k8slens/extensions/alebcay--openlens-node-pod-menu to /home/myusername/.var/app/dev.k8slens.OpenLens/config/OpenLens +7s
error:   ┏ [EXTENSION-DISCOVERY]: failed to add extension: Error: spawn /app/open-lens/open-lens ENOENT +25ms
error:   ┃ [ 1] {
error:   ┃ [ 2]   error: Error: spawn /app/open-lens/open-lens ENOENT
error:   ┃ [ 3]       at ChildProcess._handle.onexit (node:internal/child_process:283:19)
error:   ┃ [ 4]       at onErrorNT (node:internal/child_process:478:16)
error:   ┃ [ 5]       at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
error:   ┃ [ 6]     errno: -2,
error:   ┃ [ 7]     code: 'ENOENT',
error:   ┃ [ 8]     syscall: 'spawn /app/open-lens/open-lens',
error:   ┃ [ 9]     path: '/app/open-lens/open-lens',
error:   ┃ [10]     spawnargs: [
error:   ┃ [11]       '/app/open-lens/resources/app.asar/node_modules/@k8slens/core/node_modules/npm/index.js',
error:   ┃ [12]       'install',
error:   ┃ [13]       '--audit=false',
error:   ┃ [14]       '--fund=false',
error:   ┃ [15]       '--omit=dev',
error:   ┃ [16]       '--omit=peer',
error:   ┃ [17]       '--prefer-offline',
error:   ┃ [18]       '/home/myusername/.k8slens/extensions/alebcay--openlens-node-pod-menu'
error:   ┃ [19]     ]
error:   ┃ [20]   }
error:   ┗ [21] }

I've also tried giving the flatpak permissions to my home folder, but that made no difference.

@4c0n
Copy link

4c0n commented Jul 11, 2023

Same here, installing extensions does not work.

@PaulFridrick
Copy link

Same here. I did manage to install the extension manually :
I retrieved the openlens-node-pod-menu-0.1.2.tgz archive from /run/user/<UID>/app/dev.k8slens.OpenLens/lens-extensions/, extracted it manually and put the content of the package subfolder in /home/<username>/.var/app/dev.k8slens.OpenLens/config/OpenLens/node_modules/@alebcay/openlens-node-pod-menu/. After a restart of the app the extension works.

@harmathy
Copy link
Collaborator

The packaged binaries e.g. kubectl are not accessible under the PATH variable (at least the integrated shell suggests that). Could be that ENOENT (a.k.a. "No such file or directory") means that one of those executables is not found.

@abalage
Copy link

abalage commented Oct 26, 2023

The packaged binaries e.g. kubectl are not accessible under the PATH variable (at least the integrated shell suggests that). Could be that ENOENT (a.k.a. "No such file or directory") means that one of those executables is not found.

In my case I had to manually install it. I am new to Flatpak so I leave this to others to fix.

cd /var/lib/flatpak/app/dev.k8slens.OpenLens/current/active/files/bin
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

@redtux
Copy link

redtux commented Nov 4, 2023

Hi, I am experiencing the same issue as @hugoideler with several extensions – in my case using latest OpenLens 6.5.2 with Node.js 16.17.1.

It seems that the extensions' npm dependencies are unresolved, as the respective directory is empty:

~/.var/app/dev.k8slens.OpenLens/config/OpenLens/node_modules

Maybe we'd need to run npm install manually after adding a new extension? 😺


Just in case, here is an example stacktrace for an extension that is not working:

[EXTENSIONS-LOADER]: can't load renderer for "lens-extension-network-policy-viewer": Error: Cannot find module '/home/redtux/.var/app/dev.k8slens.OpenLens/config/OpenLens/node_modules/lens-extension-network-policy-viewer/dist/renderer.js'
Require stack:
- electron/js2c/renderer_init
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at o._resolveFilename (node:electron/js2c/renderer_init:2:3833)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at o._load (node:electron/js2c/renderer_init:2:3109)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at ExtensionLoader.requireExtension (https://lens.app:42463/build/lens.js?03a1ad70a676f0817f33:575642:20)
    at https://lens.app:42463/build/lens.js?03a1ad70a676f0817f33:575594:53
    at Array.map (<anonymous>) 

I verified that the extension was correctly downloaded btw:

$ tree ~/.var/app/dev.k8slens.OpenLens/.k8slens/extensions/lens-extension-network-policy-viewer/
/home/redtux/.var/app/dev.k8slens.OpenLens/.k8slens/extensions/lens-extension-network-policy-viewer/
├── docs
│   └── screenshot.png
├── LICENSE
├── main.ts
├── package.json
├── package-lock.json
├── README.md
├── renderer.tsx
├── src
│   └── network-policy-component.tsx
├── tsconfig.json
└── webpack.config.js

3 directories, 10 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants