Commit 52ac05e5 authored by Geoff Simmons's avatar Geoff Simmons

Add a section about dev mode and TemplateConfig to the dev docs.

parent e81ae6bf
......@@ -153,3 +153,44 @@ Targets in the Makefile:
necessary, and run ``golint`` and ``go test``.
* ``clean``: run ``go clean``, and clean up other generated artifacts
## dev mode and TemplateConfig
When the controller is started with the ``-devmode``
[command-line flag](ref-cli-options.md), it reads the ``TemplateConfig``
Custom Resource from the kubeserver API; otherwise, ``TemplateConfig``
is ignored, as it is not intended for production use. See the
[docs](/docs/ref-template-cfg.md) for the authoritative reference
on ``TemplateConfig``.
Testing new templates presupposes an understanding of the source code
-- the templates defined in [``pkg/varnish/vcl``](/pkg/varnish/vcl),
the function maps used for ``text/template`` parsing, and the general
design for VCL generation.
The controller log and Event generation can help monitor the
controller's implementation of ``TemplateConfig`` configuration. The
log emits a message at level ``info`` for each template object that it
successfully updates (meaning that the template was successfully
parsed):
```
time="2021-02-21T17:25:39Z" level=info msg="TemplateConfig dev/viking-ingress-dev-tmplcfg: updated shard template"
```
If any template string cannot be parsed, a message at the ``error``
level is emitted with the error message from ``text/template``, and
the synchronization attempt for the ``TemplateConfig`` is aborted. The
message also becomes the payload of an Event of type Warning with
reason ``SyncFatalError``.
If all of the fields specified in the ``TemplateConfig`` can be
processed successfully, the log emits a message at level ``info``
summarizing the fields that were updated:
```
time="2021-02-21T17:25:39Z" level=info msg="add dev/viking-ingress-dev-tmplcfg: successfully synced: TemplateConfig dev/viking-ingress-dev-tmplcfg: updated templates: [ingress acl auth reqDisp rewrite shard]"
```
The message also becomes the payload of an Event of type Info with the
reason ``SyncSuccessful``.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment