diff --git a/pkg/tools/override/kcl.mod b/pkg/tools/override/kcl.mod new file mode 100644 index 00000000..e69de29b diff --git a/pkg/tools/override/override_test.go b/pkg/tools/override/override_test.go index b1eed6a4..a7d21f26 100644 --- a/pkg/tools/override/override_test.go +++ b/pkg/tools/override/override_test.go @@ -16,3 +16,10 @@ func TestOverrideFile(t *testing.T) { t.Fatal(err) } } + +func TestOverrideFileWithRelativeImport(t *testing.T) { + _, err := OverrideFile("./testdata/test_with_relative_import.k", []string{"config.replicas=1"}, []string{}) + if err != nil { + t.Fatal(err) + } +} diff --git a/pkg/tools/override/testdata/pkg/pkg.k b/pkg/tools/override/testdata/pkg/pkg.k new file mode 100644 index 00000000..1337a530 --- /dev/null +++ b/pkg/tools/override/testdata/pkg/pkg.k @@ -0,0 +1 @@ +a = 1 diff --git a/pkg/tools/override/testdata/test_with_relative_import.k b/pkg/tools/override/testdata/test_with_relative_import.k new file mode 100644 index 00000000..921a6205 --- /dev/null +++ b/pkg/tools/override/testdata/test_with_relative_import.k @@ -0,0 +1,6 @@ +import .pkg + +config = { + a = pkg.a + replicas: 1 +}