Skip to content

Commit

Permalink
feat: publish kubectl.RunKustomize (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Apr 16, 2024
1 parent e21b04b commit 3d7aec6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

## v0.47.0

### Added

- The former `kubectl.runKustomize` helper is now the public
`kubectl.RunKustomize`. This function allows building an existing
kustomization directory.

## v0.46.0

### Breaking changes
Expand Down
6 changes: 3 additions & 3 deletions pkg/utils/kubernetes/kubectl/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func GetKustomizedManifest(kustomization types.Kustomization, manifests ...io.Re
if err != nil {
return nil, err
}
kustomized, err := runKustomize(workDir)
kustomized, err := RunKustomize(workDir)
if err != nil {
return nil, err
}
return bytes.NewReader(kustomized), nil
}

// runKustomize runs kustomize on a path and returns the YAML output.
func runKustomize(path string) ([]byte, error) {
// RunKustomize runs kustomize on a path and returns the YAML output.
func RunKustomize(path string) ([]byte, error) {
k := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
m, err := k.Run(filesys.MakeFsOnDisk(), path)
if err != nil {
Expand Down

0 comments on commit 3d7aec6

Please sign in to comment.