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
Add the ability to refresh the templates #2088
Comments
At this point Portainer will load external template definitions on first run, and then they are "managed" within Portainer's UI as you are seeing. I think the only way to "flush and reload" your templates definitions is to remove all the templates loaded into Portainer (via API calls) and then restart your Portainer container with --templates. I'm in a similar situation (just want templates loaded from our vetted templates.json URL). For now I'm just contemplating a nightly delete (via API) and container re-create. Would be nice if there was an option for pre 1.19 style template hosting, but not sure if that will come. So for now I think that's the route. As for editing templates that have been loaded, it looks like all "admin" users are allowed. I don't think there is a way to disable that (which would be nice also :) ). Regards.. |
Agree. We will add an admin option to reset templates, which will force a reread from any externally set template files, or from Portainers curated list. Expect a 1.19.2 release in the near future.
Rgds,
Neil Cresswell
On 31/07/2018, at 7:53 AM, James <notifications@github.com<mailto:notifications@github.com>> wrote:
At this point Portainer will load external template definitions on first run, and then they are "managed" within Portainer's UI as you are seeing. I think the only way to "flush and reload" your templates definitions is to remove all the templates loaded into Portainer (via API calls) and then restart your Portainer container with --templates.
I'm in a similar situation (just want templates loaded from our vetted templates.json URL). For now I'm just contemplating a nightly delete (via API) and container re-create. Would be nice if there was an option for pre 1.19 style template hosting, but not sure if that will come. So for now I think that's the route. As for editing templates that have been loaded, it looks like all "admin" users are allowed. I don't think there is a way to disable that (which would be nice also :) ).
Regards..
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_portainer_portainer_issues_2088-23issuecomment-2D408988908&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=0fx0h4vB56iTLpw2McH1ZD6TqG_QGpbggVOB-PfMJpM&m=DrB-azB1hJDmMury9h7eh_as8RViSbWyKdGt-PKfArQ&s=PjIPmLPF_V0ZDJY205R72x5zqRFnMXImTDyxRJ-nqrI&e=>, or mute the thread<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AWGrlUi-5F3gLE5Kdbqrc1S2fXKv1mD8ikks5uL2RHgaJpZM4VlDCe&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=0fx0h4vB56iTLpw2McH1ZD6TqG_QGpbggVOB-PfMJpM&m=DrB-azB1hJDmMury9h7eh_as8RViSbWyKdGt-PKfArQ&s=wRcwHZr8CmOEgAjlUw_nRia5eqdu3MbdUcfMXJpau00&e=>.
|
As @Codelica stated, external templates declared via The way to go then would be to use the HTTP API or the UI directly to update these templates. We'll definitely add a way to refresh the template list as well as an API operation. Note, the sync process will probably be based on the UI-wise, I'm thinking about adding a "Refresh" button to the templates view available for administrators only. |
Update on this topic: We're going to revert the behavior of the If the |
Sounds good. I’m traveling for a few days, but will give it a try Monday when I’m back at work. Thanks! |
I'm sorry for the late response. I deployed and played around with it over the weekend and it works really good. I'm going to deploy it on our live station and will respond if there is something else going wrong, but so far it's working great! Thank you very much. |
Hey @xvlcwk Thanks for the feedback, you should not be able to edit/create a template when using external templates, it should be disabled. I'll review it. |
I'm not able to reproduce your problem @xvlcwk When using external templates, template management (creation, edition, deletion) is disabled. External templates declared in settings: Templates view: Can you tell me how I can reproduce your problem? |
This seems to be working fine for me. It pulls our templates from our URL, doesn't show any edit options, and refreshes the template info from the URL. |
I'm very sorry. I couldn't reproduce the issue on our live instance. I'm not sure how that happened before. When portainer is unable to parse the template, it will show the "add template" button and let you put in all the variables, before telling you, that it's unable to create It. However I don't think this is a problem at all, especially cause this means someone is already ignoring a big red warning. I have no Idea how I managed to get the edit button since portainer doesn't show the templates in that case. My best guess is that I had something broken in my or portainers cache. So I'm very sorry for wasting your time. |
First off: Kudos and thank you very much for the excellent work with portainer.
I just realized that #2017 removes the possibility to host your own template files.
We used to have our templates.json in a git repo to ensure that everyone can edit them, but noone messes with them.
So I wondered what's the new recommended way to do something like that without having to add the template files by hand.
Can I mount it somewhere, where portainer will read it regularly or can I trigger a reimport of the --template paramater somehow?
I'm sorry if I'm missing something obvious.
Thanks in advance.
The text was updated successfully, but these errors were encountered: