openfaas / openfaas/faas-cli

[Feature Request] Fetch templates from configuration first

Open
#927 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

incomplete/issue-template
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

Expected Behaviour

When running faas-cli up with no template dir, it should fetch templates configured in the stack.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 running up.
But I would find it more logical if up pull automatically configured templates before default ones.

Your Environment

  • FaaS-CLI version: 0.14.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the faas-cli up entry point and trace how it handles stack.yml template configuration and the default template fetch; compare that flow with faas-cli template pull. Done means configured templates are fetched first and the official templates are skipped when all required templates are available from configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.