// Code generated by "mdtogo"; DO NOT EDIT. package api var ConfigIoLong = `# Configuration IO API Semantics Resource Configuration may be read / written from / to sources such as directories, stdin|out or network. Tools may be composed using pipes such that the tools writing Resource Configuration may be a different tool from the one that read the configuration. In order for tools to be composed in this way, while preserving origin information -- such as the original file, index, etc.: Tools **SHOULD** insert the following annotations when reading from sources, and **SHOULD** delete the annotations when writing to sinks. ### ` + "`" + `config.kubernetes.io/path` + "`" + ` Records the slash-delimited, OS-agnostic, relative file path to a Resource. This annotation **SHOULD** be set when reading Resources from files. It **SHOULD** be unset when writing Resources to files. When writing Resources to a directory, the Resource **SHOULD** be written to the corresponding path relative to that directory. Example: metadata: annotations: config.kubernetes.io/path: "relative/file/path.yaml" ### ` + "`" + `config.kubernetes.io/index` + "`" + ` Records the index of a Resource in file. In a multi-object YAML file, Resources are separated by three dashes (` + "`" + `---` + "`" + `), and the index represents the position of the Resource starting from zero. This annotation **SHOULD** be set when reading Resources from files. It **SHOULD** be unset when writing Resources to files. When writing multiple Resources to the same file, the Resource **SHOULD** be written in the relative order matching the index. When this annotation is not specified, it implies a value of ` + "`" + `0` + "`" + `. Example: metadata: annotations: config.kubernetes.io/path: "relative/file/path.yaml" config.kubernetes.io/index: 2 This represents the third Resource in the file. ### ` + "`" + `config.kubernetes.io/local-config` + "`" + ` ` + "`" + `config.kubernetes.io/local-config` + "`" + ` declares that the configuration is to local tools rather than a remote Resource. e.g. The ` + "`" + `Kustomization` + "`" + ` config in a ` + "`" + `kustomization.yaml` + "`" + ` **SHOULD** contain this annotation so that tools know it is not intended to be sent to the Kubernetes api server. Example: metadata: annotations: config.kubernetes.io/local-config: "true"` var ( FunctionsImplShort = `Following is an example for implementing an nginx abstraction using a configuration` FunctionsImplLong = `# Running Configuration Functions using kustomize CLI Configuration functions can be implemented using any toolchain and invoked using any container workflow orchestrator including Tekton, Cloud Build, or run directly using ` + "`" + `docker run` + "`" + `. Run ` + "`" + `config help docs-fn-spec` + "`" + ` to see the Configuration Functions Specification. ` + "`" + `kustomize fn run` + "`" + ` is an example orchestrator for invoking Configuration Functions. This document describes how to implement and invoke an example function. function. ### ` + "`" + `nginx-template.sh` + "`" + ` ` + "`" + `nginx-template.sh` + "`" + ` is a simple bash script which uses a _heredoc_ as a templating solution for generating Resources from the functionConfig input fields. The script wraps itself using ` + "`" + `config run wrap -- $0` + "`" + ` which will: 1. Parse the ` + "`" + `ResourceList.functionConfig` + "`" + ` (provided to the container stdin) into env vars 2. Merge the stdout into the original list of Resources 3. Defaults filenames for newly generated Resources (if they are not set as annotations) to ` + "`" + `config/NAME_KIND.yaml` + "`" + ` 4. Format the output #!/bin/bash # script must run wrapped by "kustomize fn run wrap" # for parsing input the functionConfig into env vars if [ -z ${WRAPPED} ]; then export WRAPPED=true config run wrap -- $0 exit $? fi cat < result: ` + "`" + `5` + "`" + ` - non-associative lists -- lists without a merge key - if present only in the dest, it keeps its value - if present in the src and is non-null, take the src value -- if ` + "`" + `null` + "`" + `, clear it - example src: ` + "`" + `[1, 2, 3]` + "`" + `, dest: ` + "`" + `[a, b, c]` + "`" + ` => result: ` + "`" + `[1, 2, 3]` + "`" + ` - map keys and fields -- paired by the map-key / field-name - if present only in the dest, it keeps its value - if present only in the src, it is added to the dest - if the field is present in both the src and dest, and the src value is ` + "`" + `null` + "`" + `, the field is removed from the dest - if the field is present in both the src and dest, the value is recursively merged - example src: ` + "`" + `{'key1': 'value1', 'key2': 'value2'}` + "`" + `, dest: ` + "`" + `{'key2': 'value0', 'key3': 'value3'}` + "`" + ` => result: ` + "`" + `{'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}` + "`" + ` - associative list elements -- paired by the associative key - if present only in the dest, it keeps its value in the list - if present only in the src, it is added to the dest list - if the field is present in both the src and dest, the value is recursively merged ### Associative Keys Associative keys are used to identify "same" elements within 2 different lists, and merge them. The following fields are recognized as associative keys: [` + "`" + `mountPath` + "`" + `, ` + "`" + `devicePath` + "`" + `, ` + "`" + `ip` + "`" + `, ` + "`" + `type` + "`" + `, ` + "`" + `topologyKey` + "`" + `, ` + "`" + `name` + "`" + `, ` + "`" + `containerPort` + "`" + `] Any lists where all of the elements contain associative keys will be merged as associative lists. ### Example > Source apiVersion: apps/v1 kind: Deployment spec: replicas: 3 # scalar template: spec: containers: # associative list -- (name) - name: nginx image: nginx:1.7 command: ['new_run.sh', 'arg1'] # non-associative list - name: sidecar2 image: sidecar2:v1 > Destination apiVersion: apps/v1 kind: Deployment spec: replicas: 1 template: spec: containers: - name: nginx image: nginx:1.6 command: ['old_run.sh', 'arg0'] - name: sidecar1 image: sidecar1:v1 > Result apiVersion: apps/v1 kind: Deployment spec: replicas: 3 # scalar template: spec: containers: # associative list -- (name) - name: nginx image: nginx:1.7 command: ['new_run.sh', 'arg1'] # non-associative list - name: sidecar1 image: sidecar1:v1 - name: sidecar2 image: sidecar2:v1` var Merge3Long = `# Merge (3-way) 3-way merge identifies changes between an original source + updated source and merges the result into a destination, overriding the destination fields where they have changed between original and updated. ### Resource MergeRules - Resources present in the original and deleted from the update are deleted. - Resources missing from the original and added in the update are added. - Resources present only in the dest are kept without changes. - Resources present in both the update and the dest have their fields merged with the destination. ### Field Merge Rules Fields are recursively merged using the following rules: - scalars - if present in either dest or updated and ` + "`" + `null` + "`" + `, clear the value - if unchanged between original and updated, keep dest value - if changed between original and updated (added, deleted, changed), take the updated value - non-associative lists -- lists without a merge key - if present in either dest or updated and ` + "`" + `null` + "`" + `, clear the value - if unchanged between original and updated, keep dest value - if changed between original and updated (added, deleted, changed), take the updated value - map keys and fields -- paired by the map-key / field-name - if present in either dest or updated and ` + "`" + `null` + "`" + `, clear the value - if present only in the dest, it keeps its value - if not-present in the dest, add the delta between original-updated as a field - otherwise recursively merge the value between original, updated, dest - associative list elements -- paired by the associative key - if present only in the dest, it keeps its value - if not-present in the dest, add the delta between original-updated as a field - otherwise recursively merge the value between original, updated, dest ### Associative Keys Associative keys are used to identify "same" elements within 2 different lists, and merge them. The following fields are recognized as associative keys: [` + "`" + `mountPath` + "`" + `, ` + "`" + `devicePath` + "`" + `, ` + "`" + `ip` + "`" + `, ` + "`" + `type` + "`" + `, ` + "`" + `topologyKey` + "`" + `, ` + "`" + `name` + "`" + `, ` + "`" + `containerPort` + "`" + `] Any lists where all of the elements contain associative keys will be merged as associative lists.`