Skip to content

Commit

Permalink
Merge pull request #2283 from phanimarupaka/AddFieldSetterFilter
Browse files Browse the repository at this point in the history
Add FieldSetter filter
  • Loading branch information
k8s-ci-robot authored Mar 17, 2020
2 parents 7840b7f + 702b10d commit c4d9493
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kyaml/setters2/settersutil/fieldsetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/openapi"
"sigs.k8s.io/kustomize/kyaml/setters2"
"sigs.k8s.io/kustomize/kyaml/yaml"
)

// FieldSetter sets the value for a field setter.
Expand All @@ -23,6 +24,17 @@ type FieldSetter struct {
Description string

SetBy string

Count int

OpenAPIPath string

ResourcesPath string
}

func (fs *FieldSetter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) {
fs.Count, _ = fs.Set(fs.OpenAPIPath, fs.ResourcesPath)
return nil, nil
}

// Set updates the OpenAPI definitions and resources with the new setter value
Expand Down

0 comments on commit c4d9493

Please sign in to comment.