diff --git a/cmd/plugin_list.go b/cmd/plugin_list.go index fa3a5f27..49b0867c 100644 --- a/cmd/plugin_list.go +++ b/cmd/plugin_list.go @@ -1,6 +1,8 @@ package cmd import ( + "path/filepath" + "github.com/gatewayd-io/gatewayd/config" "github.com/getsentry/sentry-go" "github.com/spf13/cobra" @@ -32,7 +34,13 @@ var pluginListCmd = &cobra.Command{ defer sentry.Recover() } - listPlugins(cmd, pluginConfigFile, onlyEnabled) + path, err := filepath.Abs(pluginConfigFile) + if err != nil { + cmd.Println("Error getting absolute path of plugin config file: ", err) + return + } + + listPlugins(cmd, path, onlyEnabled) }, } diff --git a/cmd/run_test.go b/cmd/run_test.go index 6487641f..b9ae34bf 100644 --- a/cmd/run_test.go +++ b/cmd/run_test.go @@ -129,7 +129,7 @@ func Test_runCmdWithTLS(t *testing.T) { // Test_runCmdWithMultiTenancy tests the run command with multi-tenancy enabled. // Note: This test needs two instances of PostgreSQL running on ports 5432 and 5433. func Test_runCmdWithMultiTenancy(t *testing.T) { - globalTestConfigFile := "testdata/gatewayd.yaml" + globalTestConfigFile := "./testdata/gatewayd.yaml" pluginTestConfigFile := "./test_plugins_runCmdWithMultiTenancy.yaml" // Create a test plugins config file. _, err := executeCommandC(rootCmd, "plugin", "init", "--force", "-p", pluginTestConfigFile) diff --git a/cmd/utils.go b/cmd/utils.go index fdac79d1..550c62e2 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -294,6 +294,7 @@ func extractTarGz(filename, dest string) ([]string, error) { if err != nil { return nil, gerr.ErrExtractFailed.Wrap(err) } + defer uncompressedStream.Close() // Create the output directory if it doesn't exist. if err := os.MkdirAll(dest, FolderPermissions); err != nil {