From 6fbab07df54ff49a35f5c9f4b4ea6ac6b2aea9df Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Mon, 16 Dec 2019 12:57:15 +0900 Subject: [PATCH] Fixed a wrong path and run `make generate` --- cmd/config/docs/tutorials/function-basics.md | 4 +- cmd/config/go.mod | 1 + cmd/config/go.sum | 3 ++ cmd/config/internal/generateddocs/api/docs.go | 11 ++--- .../internal/generateddocs/commands/docs.go | 49 +++++++++---------- .../internal/generateddocs/tutorials/docs.go | 15 +++--- .../examples/template-go-nginx/README.md | 2 +- .../template-heredoc-cockroachdb/README.md | 2 +- 8 files changed, 44 insertions(+), 43 deletions(-) diff --git a/cmd/config/docs/tutorials/function-basics.md b/cmd/config/docs/tutorials/function-basics.md index 63702e97a..39cf67989 100644 --- a/cmd/config/docs/tutorials/function-basics.md +++ b/cmd/config/docs/tutorials/function-basics.md @@ -39,7 +39,7 @@ #### 2. Modify the Generated Resources - modify the generated Resources by adding an annotation, sidecar container, etc. - - modify the `local-resources/example-use.yaml` by changing the replicas + - modify the `local-resource/example-use.yaml` by changing the replicas re-run `run`. this will apply the updated replicas to the generated Resources, but keep the fields that you manually added to the generated Resource configuration. @@ -86,7 +86,7 @@ #### 2. Modify the Generated Resources - modify the generated Resources by adding an annotation, sidecar container, etc. - - modify the `local-resources/example-use.yaml` by changing the replicas + - modify the `local-resource/example-use.yaml` by changing the replicas re-run `run`. this will apply the updated replicas to the generated Resources, but keep the fields that you manually added to the generated Resource configuration. diff --git a/cmd/config/go.mod b/cmd/config/go.mod index 1378e6029..19bec0e25 100644 --- a/cmd/config/go.mod +++ b/cmd/config/go.mod @@ -10,6 +10,7 @@ require ( github.com/stretchr/testify v1.4.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect k8s.io/apimachinery v0.17.0 + sigs.k8s.io/kustomize/cmd/mdtogo v0.0.0-20191213230335-75e9079baaad // indirect sigs.k8s.io/kustomize/kyaml v0.0.0 ) diff --git a/cmd/config/go.sum b/cmd/config/go.sum index a18430907..65e2335a0 100644 --- a/cmd/config/go.sum +++ b/cmd/config/go.sum @@ -149,5 +149,8 @@ k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= +sigs.k8s.io/kustomize/cmd/mdtogo v0.0.0-20191213230335-75e9079baaad h1:B3SHbhBKifnksHoh0m+z55nB7ueHFcPZBNHgGqwOf38= +sigs.k8s.io/kustomize/cmd/mdtogo v0.0.0-20191213230335-75e9079baaad/go.mod h1:arffnBwv6VTLUY3hxATxJ2fwNMWy92GSXm6UXEjFddQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/cmd/config/internal/generateddocs/api/docs.go b/cmd/config/internal/generateddocs/api/docs.go index d0ea008d5..374b436bf 100644 --- a/cmd/config/internal/generateddocs/api/docs.go +++ b/cmd/config/internal/generateddocs/api/docs.go @@ -1,10 +1,9 @@ -// Copyright 2019 The Kubernetes Authors. -// SPDX-License-Identifier: Apache-2.0 + // Code generated by "mdtogo"; DO NOT EDIT. package api -var ConfigFnLong = `# Configuration Functions API Semantics +var ConfigFnLong=`# Configuration Functions API Semantics Configuration Functions are functions packaged as executables in containers which enable **shift-left practices**. They configure applications and infrastructure through @@ -286,7 +285,7 @@ Following is an example of running the ` + "`" + `kustomize config run` + "`" + app: nginx instance: my-instance` -var ConfigIoLong = `# Configuration IO API Semantics +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 @@ -344,7 +343,7 @@ Example: annotations: config.kubernetes.io/local-config: "true"` -var Merge2Long = `# Merge (2-way) +var Merge2Long=`# Merge (2-way) 2-way merges fields from a source to a destination, overriding the destination fields where they differ. @@ -436,7 +435,7 @@ var Merge2Long = `# Merge (2-way) - name: sidecar2 image: sidecar2:v1` -var Merge3Long = `# Merge (3-way) +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 diff --git a/cmd/config/internal/generateddocs/commands/docs.go b/cmd/config/internal/generateddocs/commands/docs.go index fef935bfc..3d34b85a3 100644 --- a/cmd/config/internal/generateddocs/commands/docs.go +++ b/cmd/config/internal/generateddocs/commands/docs.go @@ -1,17 +1,16 @@ -// Copyright 2019 The Kubernetes Authors. -// SPDX-License-Identifier: Apache-2.0 + // Code generated by "mdtogo"; DO NOT EDIT. package commands -var CatShort = `[Alpha] Print Resource Config from a local directory.` -var CatLong = ` +var CatShort=`[Alpha] Print Resource Config from a local directory.` +var CatLong=` [Alpha] Print Resource Config from a local directory. DIR: Path to local directory. ` -var CatExamples = ` +var CatExamples=` # print Resource config from a directory kustomize config cat my-dir/ @@ -21,8 +20,8 @@ var CatExamples = ` # unwrap Resource config from a directory in an ResourceList ... | kustomize config cat` -var CompletionShort = `Install shell completion.` -var CompletionLong = ` +var CompletionShort=`Install shell completion.` +var CompletionLong=` Install shell completion for kustomize commands and flags -- supports bash, fish and zsh. kustomize install-completion @@ -38,19 +37,19 @@ To uninstall shell completion run: COMP_UNINSTALL=1 kustomize install-completion` -var CountShort = `[Alpha] Count Resources Config from a local directory.` -var CountLong = ` +var CountShort=`[Alpha] Count Resources Config from a local directory.` +var CountLong=` [Alpha] Count Resources Config from a local directory. DIR: Path to local directory. ` -var CountExamples = ` +var CountExamples=` # print Resource counts from a directory kustomize config count my-dir/` -var FmtShort = `[Alpha] Format yaml configuration files.` -var FmtLong = ` +var FmtShort=`[Alpha] Format yaml configuration files.` +var FmtLong=` [Alpha] Format yaml configuration files. Fmt will format input by ordering fields and unordered list items in Kubernetes @@ -76,7 +75,7 @@ field paths. - .spec.template.spec.containers (by element name) - .webhooks.rules.operations (by element value) ` -var FmtExamples = ` +var FmtExamples=` # format file1.yaml and file2.yml kustomize config fmt file1.yaml file2.yml @@ -89,8 +88,8 @@ var FmtExamples = ` # format kustomize output kustomize build | kustomize config fmt` -var GrepShort = `[Alpha] Search for matching Resources in a directory or from stdin` -var GrepLong = ` +var GrepShort=`[Alpha] Search for matching Resources in a directory or from stdin` +var GrepLong=` [Alpha] Search for matching Resources in a directory or from stdin. QUERY: @@ -103,7 +102,7 @@ var GrepLong = ` DIR: Path to local directory. ` -var GrepExamples = ` +var GrepExamples=` # find Deployment Resources kustomize config grep "kind=Deployment" my-dir/ @@ -116,8 +115,8 @@ var GrepExamples = ` # look for Resources matching a specific container image kustomize config grep "spec.template.spec.containers[name=nginx].image=nginx:1\.7\.9" my-dir/ | kustomize config tree` -var MergeShort = `[Alpha] Merge Resource configuration files` -var MergeLong = ` +var MergeShort=`[Alpha] Merge Resource configuration files` +var MergeLong=` [Alpha] Merge Resource configuration files Merge reads Kubernetes Resource yaml configuration files from stdin or sources packages and write @@ -133,11 +132,11 @@ For information on merge rules, run: kustomize config docs merge ` -var MergeExamples = ` +var MergeExamples=` cat resources_and_patches.yaml | kustomize config merge > merged_resources.yaml` -var RunFnsShort = `[Alpha] Reoncile config functions to Resources.` -var RunFnsLong = ` +var RunFnsShort=`[Alpha] Reoncile config functions to Resources.` +var RunFnsLong=` [Alpha] Reconcile config functions to Resources. run sequentially invokes all config functions in the directory, providing Resources @@ -182,11 +181,11 @@ order they appear in the file). See ` + "`" + `kustomize help config docs-fn` + "`" + ` for more details on writing functions. ` -var RunFnsExamples = ` +var RunFnsExamples=` kustomize config run example/` -var TreeShort = `[Alpha] Display Resource structure from a directory or stdin.` -var TreeLong = ` +var TreeShort=`[Alpha] Display Resource structure from a directory or stdin.` +var TreeLong=` [Alpha] Display Resource structure from a directory or stdin. kustomize config tree may be used to print Resources in a directory or cluster, preserving structure @@ -206,7 +205,7 @@ kustomize config tree supports printing arbitrary fields using the '--field' fla By default, kustomize config tree uses the directory structure for the tree structure, however when printing from the cluster, the Resource graph structure may be used instead. ` -var TreeExamples = ` +var TreeExamples=` # print Resources using directory structure kustomize config tree my-dir/ diff --git a/cmd/config/internal/generateddocs/tutorials/docs.go b/cmd/config/internal/generateddocs/tutorials/docs.go index 3f5e81c9e..c30f3c1b3 100644 --- a/cmd/config/internal/generateddocs/tutorials/docs.go +++ b/cmd/config/internal/generateddocs/tutorials/docs.go @@ -1,11 +1,10 @@ -// Copyright 2019 The Kubernetes Authors. -// SPDX-License-Identifier: Apache-2.0 + // Code generated by "mdtogo"; DO NOT EDIT. package tutorials -var ConfigurationBasicsShort = `### Synopsis` -var ConfigurationBasicsLong = ` +var ConfigurationBasicsShort=`### Synopsis` +var ConfigurationBasicsLong=` ` + "`" + `kustomize config` + "`" + ` provides tools for working with local configuration directories. First fetch a bundle of configuration to your local file system from the @@ -277,8 +276,8 @@ var ConfigurationBasicsLong = ` │   └── image: ...` -var FunctionBasicsShort = `### Synopsis` -var FunctionBasicsLong = ` +var FunctionBasicsShort=`### Synopsis` +var FunctionBasicsLong=` ` + "`" + `kustomize config` + "`" + ` enables encapsulating function for manipulating Resource configuration inside containers, which are run using ` + "`" + `run` + "`" + `. @@ -316,7 +315,7 @@ var FunctionBasicsLong = ` #### 2. Modify the Generated Resources - modify the generated Resources by adding an annotation, sidecar container, etc. - - modify the ` + "`" + `local-resources/example-use.yaml` + "`" + ` by changing the replicas + - modify the ` + "`" + `local-resource/example-use.yaml` + "`" + ` by changing the replicas re-run ` + "`" + `run` + "`" + `. this will apply the updated replicas to the generated Resources, but keep the fields that you manually added to the generated Resource configuration. @@ -363,7 +362,7 @@ var FunctionBasicsLong = ` #### 2. Modify the Generated Resources - modify the generated Resources by adding an annotation, sidecar container, etc. - - modify the ` + "`" + `local-resources/example-use.yaml` + "`" + ` by changing the replicas + - modify the ` + "`" + `local-resource/example-use.yaml` + "`" + ` by changing the replicas re-run ` + "`" + `run` + "`" + `. this will apply the updated replicas to the generated Resources, but keep the fields that you manually added to the generated Resource configuration. diff --git a/functions/examples/template-go-nginx/README.md b/functions/examples/template-go-nginx/README.md index ad6bc133d..94e529328 100644 --- a/functions/examples/template-go-nginx/README.md +++ b/functions/examples/template-go-nginx/README.md @@ -29,7 +29,7 @@ with `metadata.configFn` and running: kustomize config run local-resource/ -This generates the `local-resources/config` directory containing the template output. +This generates the `local-resource/config` directory containing the template output. - the template output may be modified by adding fields -- such as initContainers, sidecarConatiners, cpu resource limits, etc -- and these fields will be retained diff --git a/functions/examples/template-heredoc-cockroachdb/README.md b/functions/examples/template-heredoc-cockroachdb/README.md index 90c39cfc8..da390b012 100644 --- a/functions/examples/template-heredoc-cockroachdb/README.md +++ b/functions/examples/template-heredoc-cockroachdb/README.md @@ -24,7 +24,7 @@ with `metadata.configFn` and running: kustomize config run local-resource/ -This generates the `local-resources/config` directory containing the template output. +This generates the `local-resource/config` directory containing the template output. - the template output may be modified by adding fields -- such as initContainers, sidecarConatiners, cpu resource limits, etc -- and these fields will be retained