func/templates
Lance Ball ab194d421d
feat(templates): remove liveness and readiness from defaults (#1555)
* feat(templates): remove liveness and readiness from defaults

The liveness and readiness URLs are defined in code as defaulting to
`/health/liveness` and `/health/readiness` respectively. The deploy
command handles these defaults without requiring them to exist in the
`func.yaml` file. Existing tests for defaults and overrides already
exist, so this change does not require additional tests to be included.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove default endpoints from repository.go

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-02-16 08:23:51 +00:00
..
go feat: Change Invocation.format to Invoke (#1415) 2022-11-11 11:20:19 +00:00
node deps(node,typescript): update dependencies (#1468) 2023-01-16 02:33:53 +00:00
python feat: Change Invocation.format to Invoke (#1415) 2022-11-11 11:20:19 +00:00
quarkus chore: update Quarkus platform version to 2.16.2.Final (#1538) 2023-02-08 20:29:46 +00:00
rust feat: Change Invocation.format to Invoke (#1415) 2022-11-11 11:20:19 +00:00
springboot Update springboot templates to Spring Boot 3.0.2 (#1509) 2023-01-24 15:16:38 +00:00
typescript deps(node,typescript): update dependencies (#1468) 2023-01-16 02:33:53 +00:00
README.md chore: refactor repository layout (#1554) 2023-02-15 08:46:52 +00:00
manifest.yaml feat(templates): remove liveness and readiness from defaults (#1555) 2023-02-16 08:23:51 +00:00

README.md

Templates

Packaging

When updates are made to these templates, they must be packaged (serialized as a Go byte array) by running make generate/zz_filesystem_generated.go, and checking in the resultant ./generate/zz_filesystem_generated.go file.

How it works

The ./generate/templates directory contains Go program that generates ./generate/zz_filesystem_generated.go. The file defines byte array variable named TemplatesZip. The variable contains ZIP representation of the templates directory. The byte array variable is then used to instantiate exported global variable function.EmbeddedTemplatesFS, which implements standard Go interfaces fs.ReadDirFS and fs.StatFS.

Rationale

Until such time as embedding static assets in binaries is included in the base go build functionality (see https://github.com/golang/go/issues/35950) we need to use our custom serialization script (./generate/templates/main.go).

Native Go embedding introduced in Go 1.16 could be used for executable binary, however it cannot be used for library. For a library we need to generate a Go source code containing the templates.