Skip to content

Commit

Permalink
feat: add an option to set a custom kustomize binary
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Dionisi <[email protected]>
  • Loading branch information
alessiodionisi committed Sep 12, 2023
1 parent 277b40c commit 3b05200
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,24 @@ func WithLogf(logf func(string, ...interface{})) Option {
}
}

func KustomizeBin(b string) Option {
return func(r *Runner) error {
r.KustomizeBinary = b
return nil
}
}

func New(opts ...Option) *Runner {
r := &Runner{
KustomizeBinary: "",
RunCommand: RunCommand,
CopyFile: CopyFile,
WriteFile: os.WriteFile,
ReadFile: os.ReadFile,
ReadDir: os.ReadDir,
Walk: filepath.Walk,
Exists: exists,
Logf: printf,
MakeTempDir: makeTempDir,
RunCommand: RunCommand,
CopyFile: CopyFile,
WriteFile: os.WriteFile,
ReadFile: os.ReadFile,
ReadDir: os.ReadDir,
Walk: filepath.Walk,
Exists: exists,
Logf: printf,
MakeTempDir: makeTempDir,
}

for i := range opts {
Expand Down

0 comments on commit 3b05200

Please sign in to comment.