Skip to content

Commit

Permalink
add omitempty tag to replacement sources and targets
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Nov 8, 2021
1 parent 46b3cd2 commit d8f406d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/types/replacement.go
Expand Up @@ -16,10 +16,10 @@ const DefaultReplacementFieldPath = "metadata.name"
// where it is from and where it is to.
type Replacement struct {
// The source of the value.
Source *SourceSelector `json:"source" yaml:"source"`
Source *SourceSelector `json:"source,omitempty" yaml:"source,omitempty"`

// The N fields to write the value to.
Targets []*TargetSelector `json:"targets" yaml:"targets"`
Targets []*TargetSelector `json:"targets,omitempty" yaml:"targets,omitempty"`
}

// SourceSelector is the source of the replacement transformer.
Expand Down
2 changes: 0 additions & 2 deletions kustomize/commands/edit/add/addresource_test.go
Expand Up @@ -53,8 +53,6 @@ resources:
# There could be secrets in Base, if just using a fork/rebase workflow
replacements:
- path: replacement.yaml
source: null
targets: null
`)
}

Expand Down

0 comments on commit d8f406d

Please sign in to comment.