Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#5551 from colinodell/patch-1
Browse files Browse the repository at this point in the history
Improve framework documentation
  • Loading branch information
k8s-ci-robot authored Mar 6, 2024
2 parents 74ba2fb + cc410bc commit 1170431
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions kyaml/fn/framework/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
// }
Expand All @@ -24,7 +31,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
Expand Down Expand Up @@ -56,7 +63,7 @@
//
// The functionConfig may be specified declaratively and run with
//
// config run DIR/
// kustomize fn run DIR/
//
// Declarative function declaration:
//
Expand All @@ -66,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
//
Expand All @@ -75,7 +83,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.
Expand Down

0 comments on commit 1170431

Please sign in to comment.