From 7a19b856899fdad1500da5c294240771909114f6 Mon Sep 17 00:00:00 2001 From: jcope Date: Mon, 19 Oct 2020 10:30:48 -0500 Subject: [PATCH] Fix path to plugins https://gerrit.akraino.org/r/c/kni/installer/+/3790 set the build artifacts to be written to ./bin, which broke the relative path set in ApplyKustomize to the kustomize plugins. This patch adjusts the relative path appropriately. Signed-off-by: jcope Change-Id: Ic55f97baf7a95a48f09053a1a1c12d9e0d3e08d9 --- pkg/utils/utils.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index cdf85ed..f927e8d 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -42,9 +42,12 @@ func ApplyKustomize(kustomizeBinary string, kustomizePath string) []byte { if err != nil { log.Fatal("Error retrieving the current running path") } - exPath := filepath.Dir(ex) - - envVars := []string{fmt.Sprintf("XDG_CONFIG_HOME=%s/plugins", exPath)} + pluginPath := filepath.Dir(ex) + pluginPath, err = filepath.Abs(filepath.Join(pluginPath, "../plugins")) + if err != nil { + log.Fatalf("failed get plugin path: %v", err) + } + envVars := []string{fmt.Sprintf("XDG_CONFIG_HOME=%s", pluginPath)} out, _ := ExecuteCommand("", envVars, true, false, kustomizeBinary, "build", "--enable_alpha_plugins", "--reorder", "none", kustomizePath) return out -- 2.16.6