Skip to content

Commit

Permalink
fix(scaffolding): provide custom path for kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Jul 8, 2024
1 parent 3c4ba1b commit 2fae9a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ generate.testcases-registration:

.PHONY: generate.kic-webhook-config
generate.kic-webhook-config: kic-webhook-config-generator
$(KIC_WEBHOOKCONFIG_GENERATOR)
KUSTOMIZE=$(KUSTOMIZE) $(KIC_WEBHOOKCONFIG_GENERATOR)

# ------------------------------------------------------------------------------
# Files generation checks
Expand Down
7 changes: 6 additions & 1 deletion hack/generators/kic/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"log"
"os"
"os/exec"
)

Expand All @@ -14,7 +15,11 @@ func BuildKustomizeForURLAndRef(ctx context.Context, url, ref string) ([]byte, e
kustomizeResourceURL := fmt.Sprintf("%s?ref=%s", url, ref)

log.Printf("Running 'kustomize build %s'\n", kustomizeResourceURL)
cmd := exec.CommandContext(ctx, "kustomize", "build", kustomizeResourceURL)
kustomize := "kustomize"
if k := os.Getenv("KUSTOMIZE"); k != "" {
kustomize = k
}
cmd := exec.CommandContext(ctx, kustomize, "build", kustomizeResourceURL)
stdout, err := cmd.StdoutPipe()
if err != nil {
return nil, err
Expand Down

0 comments on commit 2fae9a2

Please sign in to comment.