From 9b361c610ee78d26e9cd53c2b51f047aefc05818 Mon Sep 17 00:00:00 2001 From: Richard Marshall Date: Tue, 24 Sep 2019 07:42:27 -0700 Subject: [PATCH] docs: Exec plugin generator options --- docs/plugins/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/plugins/README.md b/docs/plugins/README.md index f250da22b6e..681df2f363c 100644 --- a/docs/plugins/README.md +++ b/docs/plugins/README.md @@ -244,6 +244,48 @@ kustomize uses an exec plugin adapter to provide marshalled resources on `stdin` and capture `stdout` for further processing. +#### Generator Options + +A generator exec plugin can adjust the generator options for the resources it emits by setting one of the following internal annotations. + +> NOTE: These annotations are local to kustomize and will not be included in the final output. + +**`kustomize.config.k8s.io/needs-hash`** + +Resources can be marked as needing to be processed by the internal hash transformer by including the `needs-hash` annotation. + +> NOTE: The value of the annotation is not used and can be any valid YAML string. + +If this annotation is set on a resource not supported by the hash transformer the build will fail. + +Example: +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: cm-test + annotations: + kustomize.config.k8s.io/needs-hash: "" +data: + foo: bar +``` + +**`kustomize.config.k8s.io/behavior`** + +The `behavior` annotation will influence how conflicts are handled for resources emitted by the plugin. Valid values include "create", "merge", and "replace" with "create" being the default. + +Example: +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: cm-test + annotations: + kustomize.config.k8s.io/behavior: "merge" +data: + foo: bar +``` + ### Go plugins Be sure to read [Go plugin caveats](goPluginCaveats.md).