This message was deleted.
# extensions
a
This message was deleted.
b
Hi @damp-agent-26487 đź‘‹ Make sure that you are using the correct properties to define the configureType https://extensions.rancher.io/extensions/api/nav/resource-page you are looking for the
isCreatable
prop. Another thing that you’ll need to do is inside your
pkg/kubearmor
folder, create a folder called
edit
, then inside create a vue file with the name of your resource like
security.kubearmor.com.kubearmorpolicy
. That should automatically be picked up by Rancher Dashboard and serve it as the appropriate
edit
/
create
view Example in Elemental: https://github.com/rancher/elemental-ui/tree/main/pkg/elemental/edit with https://github.com/rancher/elemental-ui/blob/main/pkg/elemental/elemental-config.js#L34-L40
🙏 1
d
Thank you for all the resources @busy-ability-54059 can we have gmeet call so that I can discuss what problems I am having in making my extension and what roadmap should I have while making this extension. Please tell me when you are free so that I can schedule a 15 min call
Hello everyone I have completed developing a part of my extension and want to publish it to gh-pages and import it like in the rancher master class video. The problem is that even if I am following all the steps in the video my extension is not showing the install but and the developer load just doesnt show the changes I made in the developer environment and I am not able to figure out why, Is there a way to debug so that I can find out why this is happening because I cannot see any errors and cant figure out what's wrong
Here is the link to my github repo- https://github.com/KrishAryan/kubearmorRUI/tree/main
@busy-ability-54059 i tried to install a dummy extension with no code of my own and it shows the same behaviour can you please help
b
@damp-agent-26487 I’ve taken a look at your repo and I could install your extension, but you’ve commented https://github.com/KrishAryan/kubearmorRUI/blob/main/pkg/kubearmor/index.ts#L13 so it’s not adding any pages
What Rancher version are you running?
https://github.com/KrishAryan/kubearmorRUI/blob/gh-pages/index.yaml#L13
<http://catalog.cattle.io/ui-extensions-version|catalog.cattle.io/ui-extensions-version>
2.0.0 is only present in Rancher 2.9
for an extension to be compliant with Rancher 2.8.x and 2.7.x you’ll need different annotations in https://github.com/KrishAryan/kubearmorRUI/blob/main/pkg/kubearmor/package.json#L7-L10
We plan on doing a communication about this topic to everyone on the coming days, so that every extension developer is informed
d
so if I want to have my extension running in 2.8 and 2.7 I just need to change the annotations to "catalog.cattle.io/rancher-version": ">= v2.7.0", "catalog.cattle.io/ui-extensions-version": "<= 1.2.3"?
do I need to change anything else?
for ex in sudo yarn create @rancher/app should I include some kind of versioning?
b
for Rancher 2.7 and 2.8 I would just do:
"<http://catalog.cattle.io/rancher-version|catalog.cattle.io/rancher-version>": ">= v2.7.0 < 2.9.0"
running the
yarn create @rancher/app
you can’t include any versioning. there’s no option for that. Check what we’ve done in Elemental:
main
branch is used for 2.9 and forward -> https://github.com/rancher/elemental-ui/blob/main/pkg/elemental/package.json
release-2.8.x
branch is for pre-2.9 systems -> https://github.com/rancher/elemental-ui/blob/release-2.8.x/pkg/elemental/package.json We recommend you branch because of annotations, otherwise you will have a hard time keeping versions for both worlds. Feature-wise, the extension can be the same
d
Thank you alex, I will try these suggestions and will update you as soon as I can
👍 1
Hello alex, sorry I wasnt able to contact you for a while because my OS got corrupted and it was a nightmare to repair it in a dual boot setup. I have remade the repo and applied all your suggestions. I am able to install the plugin but now there is a different kind of error I am facing "an error occured while loading the code for this extension"
Is there anyway to see the error logs for plugin installation
b
You can check the console in you browser (that won’t give you a lot of information because we are injecting a script so either that’s built correctly or not… you won’t get the root cause). Other way of debugging is to check the logs for the deployment of the
ui-plugin-operator
. In Rancher 2.9 the
ui-plugin-operator
is now built in Rancher, so I think you need to look at the actual deployment logs of Rancher which should live under this path:
/c/local/explorer/apps.deployment/cattle-system/rancher#pods
On that table view, click on the 3 dots (end of each row) and click
view logs
You built a version for Rancher system pre-2.9, but you left the shell version
2.0.1
. That won’t work. you’ll need to change this shell version to
1.2.3
then release it again.
d
That can be done by including this annotation right? "catalog.cattle.io/ui-extensions-version": "<= 1.2.3"?
b
No.
shell
is a dependency of the whole project and is the connection to Rancher dashboard. I would say that it’s the most important package extensions use. It’s defined on the root
package.json
https://github.com/KrishAryan/kubearmorRUI/blob/main/package.json#L9. As per https://extensions.rancher.io/extensions/rancher-2.9-support, for Rancher pre 2.9 you’ll need to use shell
1.2.3
and for Rancher 2.9 and forward you’ll need to use shell
2.0.1
Annotations are there to let Rancher know if a particular extension has some “limits” like
racher-version
or
ui-extensions-version
as an example… There are some others you can define https://extensions.rancher.io/extensions/extensions-configuration#configurable-annotations These might make Rancher not load/make available to install your extension if the conditions you set via annotations are “broken” (out of what you defined)
d
Thank you for explaining this concept to me Alex. I would have stumbled a lot trying to figure it out on my own. I will try this after I am done reinstalling my OS again🥲
👍 1
It's finally working 🎉🎉🤩. Thank you so much Alex I was stuck on this issue for days and now I can finally move on to develop the remaining features
🎉 1
🫡 1