-
Notifications
You must be signed in to change notification settings - Fork 225
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 Req] Template store to allow custom sub-directory path to "template" #789
Comments
I have a working local branch with this feature, should it be something that is considered valuable; I could submit a patch. The changes affect the template store pull / list / describe commands, by allowing a template store to consider an optional "path" to use instead of "./template" at the root of the repo. The stack yaml support is updated to also accept a "path" string field in addition to the "name" and "source" of a template. The template pull command is also updated to allow an optional path arg after the repository.
|
…s#789) To support hosting templates within the directory structure of an existing project, we need to allow for custom paths to the root template directory instead of requiring a separate repo with a root level template directory. Signed-off-by: Justin Israel <justinisrael@gmail.com>
What's the issue with using a templates repo? |
It would be more convenient and align with our build and deploy system to have the templates live and be versioned with the project for which they are being used. |
When hosting a custom template within a repository, it is a requirement that the templates live in a "template" folder at the root of the project. And the template store json can only reference the repository, following the expectation that templates live within that root folder.
It would be very flexible to allow a project to additionally host openfaas templates, and to choose where to place these within a sub-directory path. The template store should then also be able to describe the optional template path value.
I'm looking to see if this is a desirable feature, what aspects would need to be changed to be accepted, and whether there was an initial thought or effort to support this, or if I should contribute to it?
Expected Behaviour
A project that also provides openfaas templates should be able to host templates from:
template.json
Current Behaviour
faas-cli
has a hard-coded requirement that there be a root-level "template" directory in the repository, and a store can only define the repository:template.json
Possible Solution
If a "path" value could be provided in a template store, it could be passed into updated api functions in
faas-cli/commands
package when fetching templates. The default would still be the root level "template" directory.Context
I am working to integrate openfaas at my company, behind a restrictive proxy. My solution to providing openfaas functions and microservices is to customise the templates to use our internal container image proxy/repo, and various other custom image tweaks. I would like to host these templates within a larger project as opposed to creating a new repo solely for the templates. It would be nice for the
faas-cli
and template store logic to support this workflow.Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): 0.12.2Docker version ( Full output from:
docker version
): 19.03.08Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)? Kubernetes / faas-netes
Operating System and version (e.g. Linux, Windows, MacOS): linux
The text was updated successfully, but these errors were encountered: