Skip to content

Commit

Permalink
Merge pull request #517 from fluxcd/kustomize-fix-selector
Browse files Browse the repository at this point in the history
apis: Kustomize target selector must be a pointer
  • Loading branch information
stefanprodan committed Mar 27, 2023
2 parents c01256c + 5ea22ed commit e7086b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apis/kustomize/kustomize_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ type Patch struct {
// Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with
// an array of operation objects.
// +required
Patch string `json:"patch,omitempty"`
Patch string `json:"patch"`

// Target points to the resources that the patch document should be applied to.
// +optional
Target Selector `json:"target,omitempty"`
Target *Selector `json:"target,omitempty"`
}

// JSON6902 is a JSON6902 operation object.
Expand Down
6 changes: 5 additions & 1 deletion apis/kustomize/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kustomize/kustomize_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (g *Generator) WriteFile(dirPath string, opts ...SavingOptions) (Action, er
for _, p := range patches {
kus.Patches = append(kus.Patches, kustypes.Patch{
Patch: p.Patch,
Target: adaptSelector(&p.Target),
Target: adaptSelector(p.Target),
})
}

Expand Down

0 comments on commit e7086b2

Please sign in to comment.