Skip to content

Commit c6fb1a8

Browse files
committed
fix
Signed-off-by: John Howard <[email protected]>
1 parent 0a9f683 commit c6fb1a8

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

cmd/kgateway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM cgr.dev/chainguard/static@sha256:b2e1c3d3627093e54f6805823e73edd17ab93d6c7202e672988080c863e0412b AS distroless_source
1+
FROM cgr.dev/chainguard/static@sha256:b2e1c3d3627093e54f6805823e73edd17ab93d6c7202e672988080c863e0412b
22

33
ARG GOARCH=amd64
44

test/e2e/testutils/helper/install.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"path/filepath"
88

9+
"github.com/kgateway-dev/kgateway/v2/pkg/utils/fsutils"
910
"helm.sh/helm/v3/pkg/repo"
1011

1112
"github.com/kgateway-dev/kgateway/v2/pkg/logging"
@@ -29,8 +30,25 @@ func GetLocalChartPath(chartName string, assetDir string) (string, error) {
2930
dir = defaultTestAssetDir
3031
}
3132
rootDir := testutils.GitRootDirectory()
32-
return filepath.Join(rootDir, "install/helm", chartName), nil
33+
testAssetDir := filepath.Join(rootDir, dir)
34+
if !fsutils.IsDirectory(testAssetDir) {
35+
return "", fmt.Errorf("%s does not exist or is not a directory", testAssetDir)
36+
}
37+
38+
version, err := getChartVersion(testAssetDir, chartName)
39+
if err != nil {
40+
return "", fmt.Errorf("getting Helm chart version: %w", err)
41+
}
42+
return filepath.Join(testAssetDir, fmt.Sprintf("%s-%s.tgz", chartName, version)), nil
3343
}
44+
//func GetLocalChartPath(chartName string, assetDir string) (string, error) {
45+
// dir := assetDir
46+
// if dir == "" {
47+
// dir = defaultTestAssetDir
48+
// }
49+
// rootDir := testutils.GitRootDirectory()
50+
// return filepath.Join(rootDir, "install/helm", chartName), nil
51+
//}
3452

3553
// Parses the Helm index file and returns the version of the chart.
3654
func getChartVersion(testAssetDir string, chartName string) (string, error) {

0 commit comments

Comments
 (0)