From e25f99ee023959b1455ad6ab0e9ecfd71119720b Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Wed, 21 Feb 2024 16:56:03 -0500 Subject: [PATCH 1/6] Fix broken example --- kyaml/fn/framework/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index 1c6d591086..b9c25ba0bb 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -24,7 +24,7 @@ // functionConfig := &Example{} // // fn := func(items []*yaml.RNode) ([]*yaml.RNode, error) { -// for i := range rl.Items { +// for i := range items { // // modify the items... // } // return items, nil From 6088692165c55156538fed9dfe5d0acc21acc740 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Fri, 23 Feb 2024 11:12:00 -0500 Subject: [PATCH 2/6] Fix incorrect command name --- kyaml/fn/framework/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index b9c25ba0bb..e5f638e05e 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -75,7 +75,7 @@ // Generated ResourceList.functionConfig -- ConfigMaps // Functions may also be specified imperatively and run using: // -// kpt fn run DIR/ --image image/containing/function:impl -- value=foo +// kustomize fn run DIR/ --image image/containing/function:impl -- value=foo // // When run imperatively, a ConfigMap is generated for the functionConfig, and the command // arguments are set as ConfigMap data entries. From 9d66eb16c89e3cbd023f1e08b999fb076e023706 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Fri, 23 Feb 2024 11:14:16 -0500 Subject: [PATCH 3/6] Add import statements to help users get up-and-running faster --- kyaml/fn/framework/doc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index e5f638e05e..80798500b9 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -13,6 +13,13 @@ // // Example function implementation using framework.SimpleProcessor with a struct input // +// import ( +// "sigs.k8s.io/kustomize/kyaml/errors" +// "sigs.k8s.io/kustomize/kyaml/fn/framework" +// "sigs.k8s.io/kustomize/kyaml/kio" +// "sigs.k8s.io/kustomize/kyaml/yaml" +// ) +// // type Spec struct { // Value string `yaml:"value,omitempty"` // } From facabded61f0f7edf55a7c94c45b4fc1645f81fa Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Fri, 23 Feb 2024 11:16:15 -0500 Subject: [PATCH 4/6] Fix other command reference --- kyaml/fn/framework/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index 80798500b9..439285ae67 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -63,7 +63,7 @@ // // The functionConfig may be specified declaratively and run with // -// config run DIR/ +// kustomize fn run DIR/ // // Declarative function declaration: // From 2252fd951a38aab564c5027dfd7036b1f2d300e0 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Tue, 5 Mar 2024 17:26:35 -0500 Subject: [PATCH 5/6] Fix lint violations --- kyaml/fn/framework/doc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index 439285ae67..ab788ca7c7 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -63,7 +63,7 @@ // // The functionConfig may be specified declaratively and run with // -// kustomize fn run DIR/ +// kustomize fn run DIR/ // // Declarative function declaration: // @@ -82,7 +82,7 @@ // Generated ResourceList.functionConfig -- ConfigMaps // Functions may also be specified imperatively and run using: // -// kustomize fn run DIR/ --image image/containing/function:impl -- value=foo +// kustomize fn run DIR/ --image image/containing/function:impl -- value=foo // // When run imperatively, a ConfigMap is generated for the functionConfig, and the command // arguments are set as ConfigMap data entries. From cc410bc23a76de130e39df2b90dd7f792631e505 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Tue, 5 Mar 2024 17:31:38 -0500 Subject: [PATCH 6/6] Update the example to match what kustomize fn expects --- kyaml/fn/framework/doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kyaml/fn/framework/doc.go b/kyaml/fn/framework/doc.go index ab788ca7c7..e0fb20816f 100644 --- a/kyaml/fn/framework/doc.go +++ b/kyaml/fn/framework/doc.go @@ -73,7 +73,8 @@ // # run the function by creating this container and providing this // # Example as the functionConfig // config.kubernetes.io/function: | -// image: image/containing/function:impl +// container: +// image: image/containing/function:impl // spec: // value: foo //