-
Notifications
You must be signed in to change notification settings - Fork 224
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
[Feature Request] Fetch templates from configuration first #927
Comments
Hi @vnourdin It seems like you edited the issue template and removed some key questions. Especially, why you think faas-cli should work that way. Explaining and defending why you want us to make a custom change for you, is just as important as tell us what the change is that you desire. How is this affecting you? Why do you need the proposed change? This is your opportunity to convince us. https://github.com/openfaas/faas-cli/blob/master/.github/ISSUE_TEMPLATE.md Alex |
/add label: incomplete/issue-template |
Hi @alexellis, thanks for your response, I updated the issue with the reason why I find this behavior problematic and also the workaround I use. |
I had a quick look at this because it seemed familiar - I was recalling how the gateway priority operates. This is how the template priority is determined: Line 38 in 35fcca5
And this is how the gateway priority is determined: Line 17 in 35fcca5
During build, and prior to the target template being determined, the yaml file has been parsed so the templates configured in the stack should be known....However, if the gateway approach was followed this would break the build where a stack had both bespoke and default templated functions. So, if this was approved, I think we'd be looking to ascertain whether the stack contained any functions requiring the default templates and if it doesn't then skipping over the default template pull: Lines 165 to 168 in 35fcca5
And relying only on the configuration template pull: Lines 200 to 210 in 35fcca5
|
@vnourdin @alexellis Is this issue resolved, since now we first check for configuration template pull and if it is not present then only pull the default template repo: https://github.com/openfaas/faas-cli/blob/master/commands/build.go#L167-L181 If something still needs to be done, please inform. |
Hi @NikhilSharmaWe I don't know if it's resolved. Can you try it out and confirm?
Add to config1.yml config:
templates:
- name: golang-middleware Remove the templates:
Then check :
Looks like it's still an issue, so yes will need a fix please. Alex |
Expected Behaviour
When running
faas-cli up
with notemplate
dir, it should fetch templates configured in thestack.yml
before fetching official ones.Current Behaviour
Fetch first from https://github.com/openfaas/templates.git then from configuration.
Why do you need this?
I work with a custom template, shared across projects, so it is hosted on a git repo.
Thus, I need to pull it from my CI/CD in every project.
Currently, if I run
faas-cli up
it pulls every official template for nothing. It doesn't take a lot of time, but it's wasting network and CI/CD resources.Are you a GitHub Sponsor
No
Possible Solution
Fetch first configuration and check if all templates used are here before getting the "default" ones.
Workaround
I currently run
faas-cli template pull
to only pull my template, before runningup
.But I would find it more logical if
up
pull automatically configured templates before default ones.Your Environment
The text was updated successfully, but these errors were encountered: