Skip to content

Commit b357d68

Browse files
committed
Note on meta.json for templates
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 2daf7c7 commit b357d68

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

_posts/2025-11-19-pinned-template-versions.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,27 @@ You can pin a template in three ways:
3232
* `lang: golang-middleware@inproc` - a branch name
3333
* `lang: golang-middleware@sha-af599e` - a specific commit hash prefixed with `sha-` with a short or long SHA format
3434

35+
When specifying a release tag or branch name, an efficient shallow clone can be performed, however if you specify a SHA, a full clone of the repository is required to checkout that specific commit. A full clone could impact the performance of CI/CD pipelines if the repository is large or has a long history.
36+
3537
Finally, if you do not pin a version, then the latest version will be fetched from git whenever it is not available in the local `./template` folder.
3638

39+
> Note: if you have added the `@` character into any of your custom template names, that will no longer be supported. So if you had written `node@22`, that should ideally be renamed to `node22` or `node-22` or similar.
40+
41+
Whenever templates are expanded, a new `meta.json` file is written into each template's folder. This file will make its way into the build of any function, so that you can understand which template and version was used to build a function image once it's already been published.
42+
43+
For `golang-middleware@sha-2e6e262`, the following was written out:
44+
45+
```json
46+
{
47+
"repository": "https://github.com/openfaas/golang-http-template",
48+
"ref_name": "sha-2e6e262",
49+
"sha": "2e6e262a724fc07d4eac75612c98a8870acf5606",
50+
"written_at": "2025-11-13T18:20:02.109733766Z"
51+
}
52+
```
53+
54+
55+
3756
**How do I fetch pinned templates?**
3857

3958
The first way, is to create a new template and specify the version in the `new` command:

0 commit comments

Comments
 (0)