From 55ede5c5092a58252885352923706dc8f5e17144 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Fri, 24 May 2024 16:57:08 +0530 Subject: [PATCH 01/35] added the docs directory with design report for kpm sparse checkout Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/kpm_sparse_checkout.md diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md new file mode 100644 index 00000000..b015b292 --- /dev/null +++ b/docs/kpm_sparse_checkout.md @@ -0,0 +1,16 @@ +## KPM Sparse-Checkout feature + +## 1. Introduction +kpm which is the package management tool for KCL, does not support sparse-checkout, which means an issue arises when dealing with monorepos, which may contain many KCL packages. We need to get a solution to download specific packages instead of all in a monorepo. + +## 2. Design research +A solution to this problem lies onto using GithubAPIs for kpm. The API can be used to fetch repository contents and then processing the response data to list the sub-directories of a specific monorepo. On listing the subdirectories, we can make the user toggle between different packages and press *space* to select the packages they want according to their project. + +## 3. Implementation steps +- setting up the Github API Access +- make a request to the endpoint `GET /repos/{owner}/{repo}/contents/{path}` +- parsing the JSON response to identify directories and subdirectories +- recursively fetch and process the contents of each directory to get a full list of subdirectories +- integrate it with the kpm code + +we will use Go's standard libraries for HTTP requests and JSON decoding, might need to handle additional error and edge cases. \ No newline at end of file From 2aff90f0e17d06d82c974d5ca1db39e8a96e7b91 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Sat, 25 May 2024 05:53:30 +0530 Subject: [PATCH 02/35] slight changes Signed-off-by: d4v1d03 Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index b015b292..5c00b544 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -4,13 +4,35 @@ kpm which is the package management tool for KCL, does not support sparse-checkout, which means an issue arises when dealing with monorepos, which may contain many KCL packages. We need to get a solution to download specific packages instead of all in a monorepo. ## 2. Design research -A solution to this problem lies onto using GithubAPIs for kpm. The API can be used to fetch repository contents and then processing the response data to list the sub-directories of a specific monorepo. On listing the subdirectories, we can make the user toggle between different packages and press *space* to select the packages they want according to their project. +A solution to this problem lies onto using GithubAPIs for kpm. The API can be used to fetch repository contents and then processing the response data to list the sub-directories of a specific monorepo. -## 3. Implementation steps +## 3. User Interface +The user will have to enter the command +``` +kpm add +``` +to get the list of all the subdirectories(recursively all the directories which had a kcl.mod file in it). The user now has to toggle between the output subdirectories and press 'space' to select the ones which they want to keep. + +Considering the nginx-ingres module, on typing the command + +``` +kpm add +``` +kpm will list the two subdirectories as +- restrict-ingress-annotations +- restrict-ingress-paths + +The user now has to select which package they want according to their project. + +The experience for the user will be completely different than any other package manager installing packages or package subdirectories. + +## 4. Implementation steps for the functionality - setting up the Github API Access - make a request to the endpoint `GET /repos/{owner}/{repo}/contents/{path}` - parsing the JSON response to identify directories and subdirectories - recursively fetch and process the contents of each directory to get a full list of subdirectories -- integrate it with the kpm code +- integrate it with the kpm code and update the kcl.mod accordingly + +## 5. Integration and the use of go-getter to download the specific subdirectories -we will use Go's standard libraries for HTTP requests and JSON decoding, might need to handle additional error and edge cases. \ No newline at end of file +The repoUrl field in the struct `CloneOptions` in kpm/pkg/git/git.go will be given the subdir url accordingly, which then downloads each selected subdirectory one by one. From a99b9a6f92f86cddf8f621245b30d30c1ef15595 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Sat, 25 May 2024 05:56:06 +0530 Subject: [PATCH 03/35] slight changes Signed-off-by: d4v1d03 Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index 5c00b544..c074d1c0 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -36,3 +36,5 @@ The experience for the user will be completely different than any other package ## 5. Integration and the use of go-getter to download the specific subdirectories The repoUrl field in the struct `CloneOptions` in kpm/pkg/git/git.go will be given the subdir url accordingly, which then downloads each selected subdirectory one by one. + +Also, the kcl.mod file will contain the list of all the subdirectories kept child to the main directory(if so). From cacaaea7c1467e4d86e890315a1d4a8ba577e528 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 11:25:52 +0800 Subject: [PATCH 04/35] feat: add StoreModLockFile and StoreModFile to store modfile and lockfile to local system Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/api/kpm_pkg.go | 10 ++++ pkg/api/kpm_run_test.go | 50 +++++++++++++++++++ .../store_mod_and_lock/dep1_0.0.1/kcl.mod | 7 +++ .../dep1_0.0.1/kcl.mod.lock | 9 ++++ .../test_data/store_mod_and_lock/expect.mod | 7 +++ .../store_mod_and_lock/expect.mod.lock | 9 ++++ 6 files changed, 92 insertions(+) create mode 100644 pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod create mode 100644 pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod.lock create mode 100644 pkg/api/test_data/store_mod_and_lock/expect.mod create mode 100644 pkg/api/test_data/store_mod_and_lock/expect.mod.lock diff --git a/pkg/api/kpm_pkg.go b/pkg/api/kpm_pkg.go index 357976fb..b50b7f3d 100644 --- a/pkg/api/kpm_pkg.go +++ b/pkg/api/kpm_pkg.go @@ -67,6 +67,16 @@ func (pkg *KclPackage) UpdateDependencyInPath(pkg_path string) error { return kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true) } +// StoreModFile stores the kcl.mod file of the package to local file system. +func (pkg *KclPackage) StoreModFile() error { + return pkg.pkg.ModFile.StoreModFile() +} + +// StoreModLockFile stores the kcl.mod.lock file of the package to local file system. +func (pkg *KclPackage) StoreModLockFile() error { + return pkg.pkg.LockDepsVersion() +} + // GetPkgName returns the name of the package. func (pkg *KclPackage) GetPkgName() string { return pkg.pkg.GetPkgName() diff --git a/pkg/api/kpm_run_test.go b/pkg/api/kpm_run_test.go index 46b17718..a5bd07c9 100644 --- a/pkg/api/kpm_run_test.go +++ b/pkg/api/kpm_run_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "kcl-lang.io/kcl-go/pkg/kcl" "kcl-lang.io/kpm/pkg/opt" + pkg "kcl-lang.io/kpm/pkg/package" "kcl-lang.io/kpm/pkg/utils" ) @@ -254,3 +255,52 @@ func TestRunWithOptsWithNoLog(t *testing.T) { assert.Equal(t, buf.String(), "") } + +func TestStoreModAndModLockFile(t *testing.T) { + testPath := getTestDir("store_mod_and_lock") + + testDep := pkg.Dependency{ + Name: "dep1", + FullName: "dep1_0.0.1", + Version: "0.0.1", + Sum: "sLr3e6W4RPrXYyswdOSiKqkHes1QHX2tk6SwxAPDqqo=", + LocalFullPath: filepath.Join(testPath, "dep1_0.0.1"), + Source: pkg.Source{ + Oci: &pkg.Oci{ + Reg: "ghcr.io", + Repo: "kcl-lang/dep1", + Tag: "0.0.1", + }, + }, + } + + testModFile := pkg.ModFile{ + Pkg: pkg.Package{ + Name: "test", + Version: "0.0.1", + Edition: "0.0.1", + }, + HomePath: filepath.Join(testPath, "dep1_0.0.1"), + Dependencies: pkg.Dependencies{ + Deps: map[string]pkg.Dependency{ + "dep1": testDep, + }, + }, + } + + testPkg := pkg.KclPkg{ + ModFile: testModFile, + HomePath: filepath.Join(testPath, "dep1_0.0.1"), + Dependencies: testModFile.Dependencies, + } + + testPackage := KclPackage{ + pkg: &testPkg, + } + + err := testPackage.StoreModFile() + assert.Equal(t, err, nil) + + err = testPackage.StoreModLockFile() + assert.Equal(t, err, nil) +} diff --git a/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod b/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod new file mode 100644 index 00000000..8f80cb27 --- /dev/null +++ b/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod @@ -0,0 +1,7 @@ +[package] +name = "test" +edition = "0.0.1" +version = "0.0.1" + +[dependencies] +dep1 = { oci = "oci://ghcr.io/kcl-lang/dep1", tag = "0.0.1" } diff --git a/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod.lock b/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod.lock new file mode 100644 index 00000000..319dd15e --- /dev/null +++ b/pkg/api/test_data/store_mod_and_lock/dep1_0.0.1/kcl.mod.lock @@ -0,0 +1,9 @@ +[dependencies] + [dependencies.dep1] + name = "dep1" + full_name = "dep1_0.0.1" + version = "0.0.1" + sum = "sLr3e6W4RPrXYyswdOSiKqkHes1QHX2tk6SwxAPDqqo=" + reg = "ghcr.io" + repo = "kcl-lang/dep1" + oci_tag = "0.0.1" diff --git a/pkg/api/test_data/store_mod_and_lock/expect.mod b/pkg/api/test_data/store_mod_and_lock/expect.mod new file mode 100644 index 00000000..8f80cb27 --- /dev/null +++ b/pkg/api/test_data/store_mod_and_lock/expect.mod @@ -0,0 +1,7 @@ +[package] +name = "test" +edition = "0.0.1" +version = "0.0.1" + +[dependencies] +dep1 = { oci = "oci://ghcr.io/kcl-lang/dep1", tag = "0.0.1" } diff --git a/pkg/api/test_data/store_mod_and_lock/expect.mod.lock b/pkg/api/test_data/store_mod_and_lock/expect.mod.lock new file mode 100644 index 00000000..319dd15e --- /dev/null +++ b/pkg/api/test_data/store_mod_and_lock/expect.mod.lock @@ -0,0 +1,9 @@ +[dependencies] + [dependencies.dep1] + name = "dep1" + full_name = "dep1_0.0.1" + version = "0.0.1" + sum = "sLr3e6W4RPrXYyswdOSiKqkHes1QHX2tk6SwxAPDqqo=" + reg = "ghcr.io" + repo = "kcl-lang/dep1" + oci_tag = "0.0.1" From 3c2bdb7a2e25fbd51906b6aadc7d647524bcacc0 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 14:39:51 +0800 Subject: [PATCH 05/35] fix: rm log 'adding' during updating the dependencies Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/client/client.go | 12 ------------ .../test_suite.stdout | 1 - 2 files changed, 13 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index c744ed76..744b8a68 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -309,18 +309,6 @@ func (c *KpmClient) resolvePkgDeps(kclPkg *pkg.KclPkg, lockDeps *pkg.Dependencie // add the dependencies in kcl.mod which not in kcl.mod.lock for name, d := range kclPkg.ModFile.Dependencies.Deps { if _, ok := kclPkg.Dependencies.Deps[name]; !ok { - if len(d.Version) == 0 { - reporter.ReportMsgTo( - fmt.Sprintf("adding '%s'", name), - c.logWriter, - ) - } else { - reporter.ReportMsgTo( - fmt.Sprintf("adding '%s' with version '%s'", name, d.Version), - c.logWriter, - ) - } - kclPkg.Dependencies.Deps[name] = d } } diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout index 17e6ee31..f4059255 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout @@ -1,2 +1 @@ -adding 'pkg2' The_first_kcl_program: Hello World! \ No newline at end of file From 629b9e2697c65eb9a2909368d529ba5878ca70bf Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 15:02:27 +0800 Subject: [PATCH 06/35] fix: fix test case Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/client/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index d0df4502..00b44831 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -1073,7 +1073,7 @@ func TestUpdateWithNoSumCheck(t *testing.T) { err = kpmcli.UpdateDeps(kclPkg) assert.Equal(t, err, nil) assert.Equal(t, utils.DirExists(filepath.Join(pkgPath, "kcl.mod.lock")), true) - assert.Equal(t, buf.String(), "adding 'helloworld' with version '0.1.1'\n") + assert.Equal(t, buf.String(), "") defer func() { _ = os.Remove(filepath.Join(pkgPath, "kcl.mod.lock")) From 313d0382087a0fb8c38dc116b58576d91d05468e Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 17:42:42 +0800 Subject: [PATCH 07/35] feat: supports add dependencies by git branch Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/client/client.go | 4 ++++ pkg/cmd/cmd_update.go | 11 +++++------ pkg/package/toml.go | 12 ++++++++++++ .../test_suite.env | 2 ++ .../test_suite.input | 1 + .../test_suite.stderr | 0 .../test_suite.stdout | 17 +++++++++++++++++ .../test_kpm_run_with_git_branch_dep/kcl.mod | 7 +++++++ .../kcl.mod.lock | 7 +++++++ .../test_kpm_run_with_git_branch_dep/main.k | 3 +++ 10 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.env create mode 100644 test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.input create mode 100644 test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stderr create mode 100644 test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stdout create mode 100644 test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod create mode 100644 test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod.lock create mode 100644 test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/main.k diff --git a/pkg/client/client.go b/pkg/client/client.go index 744b8a68..25d2bc65 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -1036,6 +1036,10 @@ func (c *KpmClient) DownloadFromGit(dep *pkg.Git, localPath string) (string, err msg = fmt.Sprintf("with commit '%s'", dep.Commit) } + if len(dep.Branch) != 0 { + msg = fmt.Sprintf("with branch '%s'", dep.Branch) + } + reporter.ReportMsgTo( fmt.Sprintf("cloning '%s' %s", dep.Url, msg), c.logWriter, diff --git a/pkg/cmd/cmd_update.go b/pkg/cmd/cmd_update.go index 32a2acc0..6cec4285 100644 --- a/pkg/cmd/cmd_update.go +++ b/pkg/cmd/cmd_update.go @@ -10,7 +10,6 @@ import ( "slices" "strings" - "github.com/dominikbraun/graph" "github.com/urfave/cli/v2" "golang.org/x/mod/module" "kcl-lang.io/kpm/pkg/client" @@ -131,8 +130,8 @@ func KpmUpdate(c *cli.Context, kpmcli *client.KpmClient) error { // GetModulesToUpdate validates if the packages is present in kcl.mod file and // find the latest version if version is not specified. Depending on the value of pkgVersion, -// modulesToUpgrade or modulesToDowngrade will be updated. -func GetModulesToUpdate(kclPkg *pkg.KclPkg, modulesToUpgrade []module.Version, modulesToDowngrade []module.Version, pkgInfo string) error { +// modulesToUpgrade or modulesToDowngrade will be updated. +func GetModulesToUpdate(kclPkg *pkg.KclPkg, modulesToUpgrade []module.Version, modulesToDowngrade []module.Version, pkgInfo string) error { pkgInfo = strings.TrimSpace(pkgInfo) pkgName, pkgVersion, err := ParseOciPkgNameAndVersion(pkgInfo) if err != nil { @@ -172,9 +171,9 @@ func GetModulesToUpdate(kclPkg *pkg.KclPkg, modulesToUpgrade []module.Version, return nil } -// InsertModuleToDeps checks whether module is present in the buildList and it is not the same as the target module, +// InsertModuleToDeps checks whether module is present in the buildList and it is not the same as the target module, // and inserts it to the dependencies of kclPkg -func InsertModuleToDeps(kclPkg *pkg.KclPkg, module module.Version, target module.Version, buildList []module.Version, reqs mvs.ReqsGraph) (error) { +func InsertModuleToDeps(kclPkg *pkg.KclPkg, module module.Version, target module.Version, buildList []module.Version, reqs mvs.ReqsGraph) error { if module.Path == target.Path || !slices.Contains(buildList, module) { return nil } @@ -196,4 +195,4 @@ func InsertModuleToDeps(kclPkg *pkg.KclPkg, module module.Version, target module } kclPkg.ModFile.Dependencies.Deps[module.Path] = d return nil -} \ No newline at end of file +} diff --git a/pkg/package/toml.go b/pkg/package/toml.go index c21ef54b..230c79a4 100644 --- a/pkg/package/toml.go +++ b/pkg/package/toml.go @@ -118,6 +118,7 @@ func (source *Source) MarshalTOML() string { const GIT_URL_PATTERN = "git = \"%s\"" const TAG_PATTERN = "tag = \"%s\"" const GIT_COMMIT_PATTERN = "commit = \"%s\"" +const GIT_BRANCH_PATTERN = "branch = \"%s\"" const VERSION_PATTERN = "version = \"%s\"" const SEPARATOR = ", " @@ -134,6 +135,12 @@ func (git *Git) MarshalTOML() string { sb.WriteString(SEPARATOR) sb.WriteString(fmt.Sprintf(GIT_COMMIT_PATTERN, git.Commit)) } + + if len(git.Branch) != 0 { + sb.WriteString(SEPARATOR) + sb.WriteString(fmt.Sprintf(GIT_BRANCH_PATTERN, git.Branch)) + } + if len(git.Version) != 0 { sb.WriteString(SEPARATOR) sb.WriteString(fmt.Sprintf(VERSION_PATTERN, git.Version)) @@ -367,6 +374,7 @@ func (source *Source) UnmarshalModTOML(data interface{}) error { const GIT_URL_FLAG = "git" const TAG_FLAG = "tag" const GIT_COMMIT_FLAG = "commit" +const GIT_BRANCH_FLAG = "branch" func (git *Git) UnmarshalModTOML(data interface{}) error { meta, ok := data.(map[string]interface{}) @@ -386,6 +394,10 @@ func (git *Git) UnmarshalModTOML(data interface{}) error { git.Commit = v } + if v, ok := meta[GIT_BRANCH_FLAG].(string); ok { + git.Branch = v + } + return nil } diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.env b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.env new file mode 100644 index 00000000..4c789529 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.env @@ -0,0 +1,2 @@ +KPM_HOME="" +KCLVM_VENDOR_HOME="" \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.input b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.input new file mode 100644 index 00000000..b69acba6 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.input @@ -0,0 +1 @@ +kpm --quiet run \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stderr new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stdout new file mode 100644 index 00000000..a2969d68 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_git_branch_dep/test_suite.stdout @@ -0,0 +1,17 @@ +a: + name: flask-demo + replicas: 1 + labels: + app: flask-demo + service: + type: NodePort + ports: + - port: 5000 + protocol: TCP + targetPort: 5000 + containers: + flaskdemo: + image: kcllang/flask_demo:8d31498e765ff67a2fa9933d4adffe067544b2fe + ports: + - protocol: TCP + containerPort: 5000 \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod new file mode 100644 index 00000000..875403f9 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod @@ -0,0 +1,7 @@ +[package] +name = "test_kpm_run_with_git_commit_dep" +edition = "0.0.1" +version = "0.0.1" + +[dependencies] +flask-demo-kcl-manifests = { git = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", branch = "main" } diff --git a/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod.lock b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod.lock new file mode 100644 index 00000000..4219f34d --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/kcl.mod.lock @@ -0,0 +1,7 @@ +[dependencies] + [dependencies.flask-demo-kcl-manifests] + name = "flask-demo-kcl-manifests" + full_name = "flask_manifests_0.0.1" + version = "0.0.1" + url = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git" + branch = "main" diff --git a/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/main.k b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/main.k new file mode 100644 index 00000000..3d8edb2c --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_with_git_branch_dep/main.k @@ -0,0 +1,3 @@ +import flask_demo_kcl_manifests as flask + +a = flask.config \ No newline at end of file From f2a160809d818eceeff9ea68b5229caa9f6a4726 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 17:56:14 +0800 Subject: [PATCH 08/35] fix: fix failed ci Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/cmd/cmd_update.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/cmd_update.go b/pkg/cmd/cmd_update.go index 6cec4285..44592061 100644 --- a/pkg/cmd/cmd_update.go +++ b/pkg/cmd/cmd_update.go @@ -10,6 +10,7 @@ import ( "slices" "strings" + "github.com/dominikbraun/graph" "github.com/urfave/cli/v2" "golang.org/x/mod/module" "kcl-lang.io/kpm/pkg/client" @@ -106,7 +107,7 @@ func KpmUpdate(c *cli.Context, kpmcli *client.KpmClient) error { return reporter.NewErrorEvent(reporter.FailedUpdatingBuildList, err, "failed to update build list") } - // get all the vertices in the graph + // get all the vertices in the graph modules, err := graph.TopologicalSort(depGraph) if err != nil { return reporter.NewErrorEvent(reporter.FailedTopologicalSort, err, "failed to sort the dependencies") From e6734fd80f9d8c6ce6c79f0f812b38405c47dae2 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 19:52:19 +0800 Subject: [PATCH 09/35] chore: bump kcl-go version to v0.9.0-alpha.2 Signed-off-by: zongz Signed-off-by: d4v1d03 --- go.mod | 35 +++++++++++++------------- go.sum | 77 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/go.mod b/go.mod index 5645d7bc..2b9756c2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.21.5 require ( - github.com/BurntSushi/toml v1.3.2 + github.com/BurntSushi/toml v1.4.0 github.com/containers/image/v5 v5.30.1 github.com/docker/distribution v2.8.3+incompatible github.com/dominikbraun/graph v0.23.0 @@ -16,15 +16,15 @@ require ( golang.org/x/mod v0.15.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 - kcl-lang.io/kcl-go v0.9.0-alpha.1.0.20240520022521-00adadd8c6f2 + kcl-lang.io/kcl-go v0.9.0-alpha.2 ) require ( - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.24.0 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute v1.25.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.36.0 // indirect + cloud.google.com/go/storage v1.38.0 // indirect dario.cat/mergo v1.0.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect @@ -55,6 +55,7 @@ require ( github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/emicklei/proto v1.13.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -75,7 +76,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -124,11 +125,11 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/yuin/goldmark v1.7.1 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/net v0.23.0 // indirect @@ -138,17 +139,17 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.18.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.162.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect + google.golang.org/api v0.169.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/grpc v1.63.2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect - kcl-lang.io/lib v0.9.0-alpha.1.0.20240520020338-198f8ebdb26a // indirect + kcl-lang.io/lib v0.9.0-alpha.2 // indirect ) require ( diff --git a/go.sum b/go.sum index 0905f7d5..8cd99ce4 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -68,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -171,8 +171,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -192,8 +192,8 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -261,8 +261,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= @@ -317,6 +315,8 @@ github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucV github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emicklei/proto v1.13.2 h1:z/etSFO3uyXeuEsVPzfl56WNgzcvIr42aQazXaQmFZY= +github.com/emicklei/proto v1.13.2/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -329,8 +329,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= @@ -486,8 +484,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -719,18 +717,18 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1051,8 +1049,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1101,8 +1100,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= -google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1215,10 +1214,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1254,8 +1253,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1305,10 +1304,10 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -kcl-lang.io/kcl-go v0.9.0-alpha.1.0.20240520022521-00adadd8c6f2 h1:APHwRVCqu3v1yHQc9ic8jU3e0Qd1LLCOGQfqeUZ0D4E= -kcl-lang.io/kcl-go v0.9.0-alpha.1.0.20240520022521-00adadd8c6f2/go.mod h1:k2qfb7uyZvGccJHmygvMTQBck907PmIC2nV3fYWWDaM= -kcl-lang.io/lib v0.9.0-alpha.1.0.20240520020338-198f8ebdb26a h1:409hMK27VF3VE9Z9cznHPVGyB4Ohvc2RxIcyU49jAmI= -kcl-lang.io/lib v0.9.0-alpha.1.0.20240520020338-198f8ebdb26a/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY= +kcl-lang.io/kcl-go v0.9.0-alpha.2 h1:eJqkNxxfuEXfzqO0k1IHd+UyYry2eV///8avr3T8AuY= +kcl-lang.io/kcl-go v0.9.0-alpha.2/go.mod h1:nwqta0C8lYxx7iJYGsCJzEqRFpi+XGndtFFLC+AVBhk= +kcl-lang.io/lib v0.9.0-alpha.2 h1:44w4YkIh45wKLYa/wqiRiqXp+JddHZnPndnJsu5sx70= +kcl-lang.io/lib v0.9.0-alpha.2/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY= oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c= From 5673c8b3603c6f8f4b88f70071cc35a2b388c0a6 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 20:30:51 +0800 Subject: [PATCH 10/35] fix: fix test cases Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/api/test_data/test_settings/kcl.yaml | 2 +- .../test_data/test_kpm_run_with_entry_sub_yaml/sub/kcl.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/api/test_data/test_settings/kcl.yaml b/pkg/api/test_data/test_settings/kcl.yaml index d61e8904..894bd2c5 100644 --- a/pkg/api/test_data/test_settings/kcl.yaml +++ b/pkg/api/test_data/test_settings/kcl.yaml @@ -1,3 +1,3 @@ kcl_cli_configs: files: - - ./test.k + - ./test_data/test_settings/test.k diff --git a/test/e2e/test_suites/test_data/test_kpm_run_with_entry_sub_yaml/sub/kcl.yaml b/test/e2e/test_suites/test_data/test_kpm_run_with_entry_sub_yaml/sub/kcl.yaml index 53da374c..ed562032 100644 --- a/test/e2e/test_suites/test_data/test_kpm_run_with_entry_sub_yaml/sub/kcl.yaml +++ b/test/e2e/test_suites/test_data/test_kpm_run_with_entry_sub_yaml/sub/kcl.yaml @@ -1,4 +1,4 @@ kcl_cli_configs: file: - - main.k - - ../main.k \ No newline at end of file + - ./sub/main.k + - main.k \ No newline at end of file From df7c07fb19135b6cd72b6dd84c17411d8bc76f25 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Tue, 28 May 2024 17:04:49 +0530 Subject: [PATCH 11/35] final design doc Signed-off-by: d4v1d03 Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 64 ++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index c074d1c0..b94c7ca0 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -3,38 +3,56 @@ ## 1. Introduction kpm which is the package management tool for KCL, does not support sparse-checkout, which means an issue arises when dealing with monorepos, which may contain many KCL packages. We need to get a solution to download specific packages instead of all in a monorepo. -## 2. Design research -A solution to this problem lies onto using GithubAPIs for kpm. The API can be used to fetch repository contents and then processing the response data to list the sub-directories of a specific monorepo. +## 2. User Worklow +- Adding a Subdirectory Dependency via Command Line +- Specifying a Subdirectory in `kcl.mod` -## 3. User Interface -The user will have to enter the command -``` -kpm add -``` -to get the list of all the subdirectories(recursively all the directories which had a kcl.mod file in it). The user now has to toggle between the output subdirectories and press 'space' to select the ones which they want to keep. +## 3. Command Line Inteface +We will try to keep the command line interface as simple and straightforward as possible for adding a Git repository subdirectory as a dependency. The below steps show how a user can use the feature: + +- Adding a Dependency : +The following command will lead to the addition of a dependency: +`kpm add ` +This command will add the specified subdirectory as a dependency in the current KCL project. + +## 4. Example Use-case Considering the nginx-ingres module, on typing the command ``` -kpm add +kpm add https://github.com/kcl-lang/modules/tree/main/nginx-ingress /restrict-ingress-anotations ``` -kpm will list the two subdirectories as -- restrict-ingress-annotations -- restrict-ingress-paths -The user now has to select which package they want according to their project. +The following command will lead to the addition of restrict-ingress-anotations package to the current KCL project and will update the kcl.mod accordingly. -The experience for the user will be completely different than any other package manager installing packages or package subdirectories. +## 5. Specifying how kcl.mod will specify the added subdirectories +To support the specification of a subdirectory for dependencies that are sourced from Git repositories, we need to extend the kcl.mod file structure. This involves adding an optional `subdirectory` field under each dependency. +A sample kcl mod for the same would look like this. -## 4. Implementation steps for the functionality -- setting up the Github API Access -- make a request to the endpoint `GET /repos/{owner}/{repo}/contents/{path}` -- parsing the JSON response to identify directories and subdirectories -- recursively fetch and process the contents of each directory to get a full list of subdirectories -- integrate it with the kpm code and update the kcl.mod accordingly +``` +[package] +name = "test" +edition = "v0.9.0" +version = "0.0.1" -## 5. Integration and the use of go-getter to download the specific subdirectories +[dependencies] +my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } +``` -The repoUrl field in the struct `CloneOptions` in kpm/pkg/git/git.go will be given the subdir url accordingly, which then downloads each selected subdirectory one by one. +## 6. Integration and the use of go-getter to download the specific subdirectories + +The repoUrl field in the struct `CloneOptions` in kpm/pkg/git/git.go will be given the subdir url accordingly, which then downloads each selected subdirectory one by one. KCL currently uses go-getter to download using URL's with ease. + +We can also provide a fallback mechanism to download the entire repo if the subdirectory download fails repeatedly by something like - + +```Go +err := downloadSubdir(repoUrl, subdir) +if err != nil { + log.Printf("Failed to download subdirectory, falling back to full repository: %v", err) + return downloadRepo(repoUrl) +} + +``` -Also, the kcl.mod file will contain the list of all the subdirectories kept child to the main directory(if so). +## 7. Conclusion +By extending the kcl.mod file to include a subdirectory field for Git-based dependencies, users can now specify and manage dependencies that reside in specific subdirectories of a Git repository. This enhancement will enable kpm to download only the necessary parts of large repositories, significantly improving performance when dealing with monorepos. The user interface remains intuitive, and the implementation leverages Git's sparse-checkout feature to achieve the desired functionality. \ No newline at end of file From 385bec4fd1fb56758a42081f0d3adf9e00402cf2 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Tue, 28 May 2024 18:12:22 +0530 Subject: [PATCH 12/35] added dictionary Signed-off-by: d4v1d03 --- pkg/package/modfile.go | 66 +++++++++++++++++++++++++- scripts/scripts/registry_auth/htpasswd | 0 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 scripts/scripts/registry_auth/htpasswd diff --git a/pkg/package/modfile.go b/pkg/package/modfile.go index 261f67d9..bf11bf46 100644 --- a/pkg/package/modfile.go +++ b/pkg/package/modfile.go @@ -2,11 +2,14 @@ package pkg import ( + "bytes" "errors" "fmt" "net/url" "os" + "io" "path/filepath" + "sort" "strings" "github.com/BurntSushi/toml" @@ -434,11 +437,18 @@ func LoadLockDeps(homePath string) (*Dependencies, error) { } // Write the contents of 'ModFile' to 'kcl.mod' file +// StoreModFile writes the contents of 'ModFile' to 'kcl.mod' file. +// It uses an ordered dictionary for serialization/deserialization to preserve the order of dependencies. func (mfile *ModFile) StoreModFile() error { fullPath := filepath.Join(mfile.HomePath, MOD_FILE) - return utils.StoreToFile(fullPath, mfile.MarshalTOML()) + tomlContent, err := mfile.MarshalTOML() + if err != nil { + return err + } + return utils.StoreToFile(fullPath, tomlContent) } + // Returns the path to the kcl.mod file func (mfile *ModFile) GetModFilePath() string { return filepath.Join(mfile.HomePath, MOD_FILE) @@ -614,3 +624,57 @@ func ParseRepoFullNameFromGitSource(gitSrc Git) (string, error) { func ParseRepoNameFromGitSource(gitSrc Git) string { return utils.ParseRepoNameFromGitUrl(gitSrc.Url) } + +// SortMapByKey will sort the dependencies by key. +func (deps *Dependencies) SortMapByKey() { + keys := make([]string, 0, len(deps.Deps)) + for k := range deps.Deps { + keys = append(keys, k) + } + sort.Strings(keys) + + sortedDeps := make(map[string]Dependency) + for _, k := range keys { + sortedDeps[k] = deps.Deps[k] + } + deps.Deps = sortedDeps +} + +// StoreModFile writes the contents of 'ModFile' to 'kcl.mod' file. +// It uses an ordered dictionary for serialization/deserialization to preserve the order of dependencies. +type OrderedTomlEncoder struct { + Encoder *toml.Encoder + Writer io.Writer +} + +// NewOrderedTomlEncoder creates a new instance of OrderedTomlEncoder. +func NewOrderedTomlEncoder(buf *bytes.Buffer) *OrderedTomlEncoder { + return &OrderedTomlEncoder{ + Encoder: toml.NewEncoder(buf), + } +} + +// Encode encodes the given value into TOML format while maintaining the field order. +func (ote *OrderedTomlEncoder) Encode(v interface{}) error { + buf := new(bytes.Buffer) + ote.Encoder.Indent = "" + err := ote.Encoder.Encode(v) + if err != nil { + return err + } + _, err = buf.WriteTo(ote.Writer) + return err +} + +// MarshalTOML marshals the ModFile to TOML format using an ordered dictionary. +func (mfile *ModFile) MarshalTOML() (string, error) { + buf := new(bytes.Buffer) + enc := NewOrderedTomlEncoder(buf) + err := enc.Encode(mfile) + if err != nil { + return "", err + } + return buf.String(), nil +} + + diff --git a/scripts/scripts/registry_auth/htpasswd b/scripts/scripts/registry_auth/htpasswd new file mode 100644 index 00000000..e69de29b From 4f4f8bf6ad466ee584391602ecdd5b70bccb341a Mon Sep 17 00:00:00 2001 From: zongz Date: Tue, 28 May 2024 19:47:51 +0800 Subject: [PATCH 13/35] fix: fix missing dependencies when add dependencies from local path Signed-off-by: zongz Signed-off-by: d4v1d03 --- pkg/client/client.go | 2 + pkg/client/client_test.go | 40 +++++++++++++++++++ .../test_data/test_add_local_path/dep/kcl.mod | 5 +++ .../test_add_local_path/dep/kcl.mod.lock | 0 .../test_data/test_add_local_path/dep/main.k | 1 + .../test_data/test_add_local_path/kcl.mod.bak | 5 +++ .../test_add_local_path/kcl.mod.lock.bak | 0 .../test_data/test_add_local_path/main.k | 1 + 8 files changed, 54 insertions(+) create mode 100644 pkg/client/test_data/test_add_local_path/dep/kcl.mod create mode 100644 pkg/client/test_data/test_add_local_path/dep/kcl.mod.lock create mode 100644 pkg/client/test_data/test_add_local_path/dep/main.k create mode 100644 pkg/client/test_data/test_add_local_path/kcl.mod.bak create mode 100644 pkg/client/test_data/test_add_local_path/kcl.mod.lock.bak create mode 100644 pkg/client/test_data/test_add_local_path/main.k diff --git a/pkg/client/client.go b/pkg/client/client.go index 25d2bc65..dda5f26a 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -759,6 +759,8 @@ func (c *KpmClient) AddDepToPkg(kclPkg *pkg.KclPkg, d *pkg.Dependency) error { // If the dependency is from the local path, do nothing. if d.IsFromLocal() { + kclPkg.ModFile.Dependencies.Deps[d.Name] = *d + kclPkg.Dependencies.Deps[d.Name] = *d return nil } diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 00b44831..d63e270e 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -1500,3 +1500,43 @@ func testRunWithOciDownloader(t *testing.T) { strings.Contains(buf.String(), "downloading 'zong-zhe/helloworld:0.0.3' from 'ghcr.io/zong-zhe/helloworld:0.0.3'") assert.Equal(t, res.GetRawYamlResult(), "The_first_kcl_program: Hello World!") } + +func TestAddLocalPath(t *testing.T) { + + kpmCli, err := NewKpmClient() + assert.Equal(t, err, nil) + + path := getTestDir("test_add_local_path") + err = copy.Copy(filepath.Join(path, "kcl.mod.bak"), filepath.Join(path, "kcl.mod")) + assert.Equal(t, err, nil) + + kclPkg, err := kpmCli.LoadPkgFromPath(path) + assert.Equal(t, err, nil) + + opts := opt.AddOptions{ + LocalPath: path, + RegistryOpts: opt.RegistryOptions{ + Local: &opt.LocalOptions{ + Path: filepath.Join(path, "dep"), + }, + }, + } + _, err = kpmCli.AddDepWithOpts(kclPkg, &opts) + assert.Equal(t, err, nil) + + modFile, err := kpmCli.LoadModFile(path) + assert.Equal(t, err, nil) + assert.Equal(t, len(modFile.Deps), 1) + assert.Equal(t, modFile.Deps["dep"].Name, "dep") + assert.Equal(t, modFile.Deps["dep"].LocalFullPath, filepath.Join(path, "dep")) + + kclPkg1, err := kpmCli.LoadPkgFromPath(path) + assert.Equal(t, err, nil) + assert.Equal(t, kclPkg1.Dependencies.Deps["dep"].Name, "dep") + assert.Equal(t, kclPkg1.Dependencies.Deps["dep"].FullName, "dep_0.0.1") + assert.Equal(t, kclPkg1.Dependencies.Deps["dep"].Version, "0.0.1") + defer func() { + _ = os.Remove(filepath.Join(path, "kcl.mod.lock")) + _ = os.Remove(filepath.Join(path, "kcl.mod")) + }() +} diff --git a/pkg/client/test_data/test_add_local_path/dep/kcl.mod b/pkg/client/test_data/test_add_local_path/dep/kcl.mod new file mode 100644 index 00000000..d86c1727 --- /dev/null +++ b/pkg/client/test_data/test_add_local_path/dep/kcl.mod @@ -0,0 +1,5 @@ +[package] +name = "dep" +edition = "v0.9.0" +version = "0.0.1" + diff --git a/pkg/client/test_data/test_add_local_path/dep/kcl.mod.lock b/pkg/client/test_data/test_add_local_path/dep/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/pkg/client/test_data/test_add_local_path/dep/main.k b/pkg/client/test_data/test_add_local_path/dep/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/pkg/client/test_data/test_add_local_path/dep/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file diff --git a/pkg/client/test_data/test_add_local_path/kcl.mod.bak b/pkg/client/test_data/test_add_local_path/kcl.mod.bak new file mode 100644 index 00000000..665ee79e --- /dev/null +++ b/pkg/client/test_data/test_add_local_path/kcl.mod.bak @@ -0,0 +1,5 @@ +[package] +name = "test_add_local_path" +edition = "v0.9.0" +version = "0.0.1" + diff --git a/pkg/client/test_data/test_add_local_path/kcl.mod.lock.bak b/pkg/client/test_data/test_add_local_path/kcl.mod.lock.bak new file mode 100644 index 00000000..e69de29b diff --git a/pkg/client/test_data/test_add_local_path/main.k b/pkg/client/test_data/test_add_local_path/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/pkg/client/test_data/test_add_local_path/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file From 1189907e1c94b15f1b5a9c2a1547bc2eea9a3165 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Tue, 28 May 2024 18:23:04 +0530 Subject: [PATCH 14/35] some fix Signed-off-by: d4v1d03 Signed-off-by: d4v1d03 --- pkg/package/modfile.go | 12 ++++-------- pkg/package/toml.go | 8 -------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/pkg/package/modfile.go b/pkg/package/modfile.go index bf11bf46..c8a13553 100644 --- a/pkg/package/modfile.go +++ b/pkg/package/modfile.go @@ -441,10 +441,7 @@ func LoadLockDeps(homePath string) (*Dependencies, error) { // It uses an ordered dictionary for serialization/deserialization to preserve the order of dependencies. func (mfile *ModFile) StoreModFile() error { fullPath := filepath.Join(mfile.HomePath, MOD_FILE) - tomlContent, err := mfile.MarshalTOML() - if err != nil { - return err - } + tomlContent := mfile.MarshalTOML() return utils.StoreToFile(fullPath, tomlContent) } @@ -667,14 +664,13 @@ func (ote *OrderedTomlEncoder) Encode(v interface{}) error { } // MarshalTOML marshals the ModFile to TOML format using an ordered dictionary. -func (mfile *ModFile) MarshalTOML() (string, error) { +func (mfile *ModFile) MarshalTOML() (string) { buf := new(bytes.Buffer) enc := NewOrderedTomlEncoder(buf) err := enc.Encode(mfile) if err != nil { - return "", err + return "" } - return buf.String(), nil + return buf.String() } - diff --git a/pkg/package/toml.go b/pkg/package/toml.go index 230c79a4..94e5e75a 100644 --- a/pkg/package/toml.go +++ b/pkg/package/toml.go @@ -33,14 +33,6 @@ import ( const NEWLINE = "\n" -func (mod *ModFile) MarshalTOML() string { - var sb strings.Builder - sb.WriteString(mod.Pkg.MarshalTOML()) - sb.WriteString(mod.Dependencies.MarshalTOML()) - sb.WriteString(mod.Profiles.MarshalTOML()) - return sb.String() -} - const PACKAGE_PATTERN = "[package]" func (pkg *Package) MarshalTOML() string { From 031049b1da11b1a13d285575bd0e66b77b1df3da Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 29 May 2024 10:24:19 +0800 Subject: [PATCH 15/35] chore: bump kcl-go to v0.9.0-beta.1 and fix the get schema type impl and test cases Signed-off-by: peefy Signed-off-by: d4v1d03 --- go.mod | 4 ++-- go.sum | 8 ++++---- pkg/api/kpm_pkg.go | 33 ++++++++++++++------------------- pkg/api/kpm_pkg_test.go | 9 ++++++--- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 2b9756c2..87a6cba0 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( golang.org/x/mod v0.15.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 - kcl-lang.io/kcl-go v0.9.0-alpha.2 + kcl-lang.io/kcl-go v0.9.0-beta.1 ) require ( @@ -149,7 +149,7 @@ require ( google.golang.org/protobuf v1.34.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect - kcl-lang.io/lib v0.9.0-alpha.2 // indirect + kcl-lang.io/lib v0.9.0-beta.1 // indirect ) require ( diff --git a/go.sum b/go.sum index 8cd99ce4..a235f167 100644 --- a/go.sum +++ b/go.sum @@ -1304,10 +1304,10 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -kcl-lang.io/kcl-go v0.9.0-alpha.2 h1:eJqkNxxfuEXfzqO0k1IHd+UyYry2eV///8avr3T8AuY= -kcl-lang.io/kcl-go v0.9.0-alpha.2/go.mod h1:nwqta0C8lYxx7iJYGsCJzEqRFpi+XGndtFFLC+AVBhk= -kcl-lang.io/lib v0.9.0-alpha.2 h1:44w4YkIh45wKLYa/wqiRiqXp+JddHZnPndnJsu5sx70= -kcl-lang.io/lib v0.9.0-alpha.2/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY= +kcl-lang.io/kcl-go v0.9.0-beta.1 h1:NfOiktimPlSx/pafqRTvPvPTh8nHtncZCFz0UQfbWiE= +kcl-lang.io/kcl-go v0.9.0-beta.1/go.mod h1:mkAN+NjbmyaVljshuneKtT4PKOZzu2Z+ayX3yWS+j0E= +kcl-lang.io/lib v0.9.0-beta.1 h1:oO/3h5Ubk61LKVnE7A9xlV4FfSfKa6Jv+KNsoHMcnNc= +kcl-lang.io/lib v0.9.0-beta.1/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY= oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c= diff --git a/pkg/api/kpm_pkg.go b/pkg/api/kpm_pkg.go index b50b7f3d..e48355ad 100644 --- a/pkg/api/kpm_pkg.go +++ b/pkg/api/kpm_pkg.go @@ -136,7 +136,7 @@ func (pkg *KclPackage) GetSchemaTypeMappingNamed(schemaName string) (map[string] } // GetFullSchemaTypeMappingWithFilters returns the full schema type filtered by the filter functions. -func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmClient, fileterFuncs []KclTypeFilterFunc) (map[string]map[string]*KclType, error) { +func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmClient, filterFuncs []KclTypeFilterFunc) (map[string]map[string]*KclType, error) { schemaTypes := make(map[string]map[string]*KclType) err := filepath.Walk(pkg.GetPkgHomePath(), func(path string, info os.FileInfo, err error) error { if err != nil { @@ -144,7 +144,7 @@ func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmCli } if info.IsDir() { - fileteredKtypeMap := make(map[string]*KclType) + filteredTypeMap := make(map[string]*KclType) depsMap, err := kpmcli.ResolveDepsIntoMap(pkg.pkg) if err != nil { @@ -156,16 +156,11 @@ func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmCli opts.Merge(kcl.WithExternalPkgs(fmt.Sprintf(constants.EXTERNAL_PKGS_ARG_PATTERN, depName, depPath))) } - schemaTypeList, err := kcl.GetFullSchemaType([]string{path}, "", *opts) + schemaTypeMap, err := kcl.GetFullSchemaTypeMapping([]string{path}, "", *opts) if err != nil && err.Error() != errors.NoKclFiles.Error() { return err } - schemaTypeMap := make(map[string]*gpyrpc.KclType) - for _, schemaType := range schemaTypeList { - schemaTypeMap[schemaType.SchemaName] = schemaType - } - relPath, err := filepath.Rel(pkg.GetPkgHomePath(), path) if err != nil { return err @@ -174,18 +169,18 @@ func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmCli for kName, kType := range schemaTypeMap { kTy := NewKclTypes(kName, relPath, kType) filterPassed := true - for _, filterFunc := range fileterFuncs { + for _, filterFunc := range filterFuncs { if !filterFunc(kTy) { filterPassed = false break } } if filterPassed { - fileteredKtypeMap[kName] = kTy + filteredTypeMap[kName] = kTy } } - if len(fileteredKtypeMap) > 0 { - schemaTypes[relPath] = fileteredKtypeMap + if len(filteredTypeMap) > 0 { + schemaTypes[relPath] = filteredTypeMap } } } @@ -201,7 +196,7 @@ func (pkg *KclPackage) GetFullSchemaTypeMappingWithFilters(kpmcli *client.KpmCli } // GetSchemaTypeMappingWithFilters returns the schema type filtered by the filter functions. -func (pkg *KclPackage) GetSchemaTypeMappingWithFilters(fileterFuncs []KclTypeFilterFunc) (map[string]map[string]*KclType, error) { +func (pkg *KclPackage) GetSchemaTypeMappingWithFilters(filterFuncs []KclTypeFilterFunc) (map[string]map[string]*KclType, error) { schemaTypes := make(map[string]map[string]*KclType) err := filepath.Walk(pkg.GetPkgHomePath(), func(path string, info os.FileInfo, err error) error { if err != nil { @@ -209,8 +204,8 @@ func (pkg *KclPackage) GetSchemaTypeMappingWithFilters(fileterFuncs []KclTypeFil } if info.IsDir() { - fileteredKtypeMap := make(map[string]*KclType) - schemaTypeMap, err := kcl.GetSchemaTypeMapping(path, "", "") + filteredTypeMap := make(map[string]*KclType) + schemaTypeMap, err := kcl.GetFullSchemaTypeMapping([]string{path}, "") if err != nil && err.Error() != errors.NoKclFiles.Error() { return err } @@ -223,18 +218,18 @@ func (pkg *KclPackage) GetSchemaTypeMappingWithFilters(fileterFuncs []KclTypeFil for kName, kType := range schemaTypeMap { kTy := NewKclTypes(kName, relPath, kType) filterPassed := true - for _, filterFunc := range fileterFuncs { + for _, filterFunc := range filterFuncs { if !filterFunc(kTy) { filterPassed = false break } } if filterPassed { - fileteredKtypeMap[kName] = kTy + filteredTypeMap[kName] = kTy } } - if len(fileteredKtypeMap) > 0 { - schemaTypes[relPath] = fileteredKtypeMap + if len(filteredTypeMap) > 0 { + schemaTypes[relPath] = filteredTypeMap } } } diff --git a/pkg/api/kpm_pkg_test.go b/pkg/api/kpm_pkg_test.go index b088d9e5..35c30134 100644 --- a/pkg/api/kpm_pkg_test.go +++ b/pkg/api/kpm_pkg_test.go @@ -1,6 +1,7 @@ package api import ( + "fmt" "path/filepath" "testing" @@ -38,7 +39,7 @@ func TestPackageApi(t *testing.T) { schemas, err := pkg.GetAllSchemaTypeMapping() assert.Equal(t, err, nil) assert.Equal(t, len(schemas), 3) - assert.Equal(t, len(schemas["."]), 4) + assert.Equal(t, len(schemas["."]), 2) assert.Equal(t, len(schemas[filepath.Join("sub")]), 1) assert.Equal(t, len(schemas[filepath.Join("sub", "sub1")]), 2) @@ -165,8 +166,10 @@ func TestGetFullSchemaTypeMappingWithFilters(t *testing.T) { assert.Equal(t, err, nil) assert.Equal(t, len(schemas), 1) - assert.Equal(t, schemas[filepath.Join(".")]["B"].Type, "schema") - assert.Equal(t, schemas[filepath.Join(".")]["B"].SchemaName, "B") + fmt.Println(schemas) + + assert.Equal(t, schemas[filepath.Join(".")]["a"].Type, "schema") + assert.Equal(t, schemas[filepath.Join(".")]["a"].SchemaName, "B") } func TestGetSchemaTypeUnderEmptyDir(t *testing.T) { From 0b24e22b86cb2f74ac5fa0f959894b53fbbc10b2 Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 29 May 2024 11:16:24 +0800 Subject: [PATCH 16/35] test: update new override spec in the v0.9.0-beta.1 version Signed-off-by: peefy Signed-off-by: d4v1d03 --- go.mod | 68 ++++----- go.sum | 134 ++++++++---------- .../test_suite.input | 2 +- .../kcl.mod | 2 +- 4 files changed, 93 insertions(+), 113 deletions(-) diff --git a/go.mod b/go.mod index 87a6cba0..c98afd1c 100644 --- a/go.mod +++ b/go.mod @@ -6,14 +6,14 @@ toolchain go1.21.5 require ( github.com/BurntSushi/toml v1.4.0 - github.com/containers/image/v5 v5.30.1 + github.com/containers/image/v5 v5.31.0 github.com/docker/distribution v2.8.3+incompatible github.com/dominikbraun/graph v0.23.0 github.com/opencontainers/image-spec v1.1.0 github.com/otiai10/copy v1.14.0 github.com/sirupsen/logrus v1.9.3 github.com/urfave/cli/v2 v2.25.0 - golang.org/x/mod v0.15.0 + golang.org/x/mod v0.17.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 kcl-lang.io/kcl-go v0.9.0-beta.1 @@ -21,15 +21,14 @@ require ( require ( cloud.google.com/go v0.112.1 // indirect - cloud.google.com/go/compute v1.25.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.38.0 // indirect dario.cat/mergo v1.0.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.12.0-rc.3 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.12.3 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/aws/aws-sdk-go v1.44.122 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect @@ -44,13 +43,13 @@ require ( github.com/containerd/containerd v1.7.11 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect - github.com/containers/ocicrypt v1.1.9 // indirect - github.com/containers/storage v1.53.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/distribution/reference v0.5.0 // indirect - github.com/docker/cli v25.0.3+incompatible // indirect - github.com/docker/docker v25.0.3+incompatible // indirect + github.com/containers/ocicrypt v1.1.10 // indirect + github.com/containers/storage v1.54.0 // indirect + github.com/cyphar/filepath-securejoin v0.2.5 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/cli v26.1.3+incompatible // indirect + github.com/docker/docker v26.1.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.1 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect @@ -64,8 +63,8 @@ require ( github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/swag v0.22.10 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/goccy/go-yaml v1.11.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -78,49 +77,41 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.17.7 // indirect - github.com/klauspost/pgzip v1.2.6 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/sys/mountinfo v0.7.1 // indirect github.com/moby/sys/user v0.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/powerman/rpc-codec v1.2.2 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.51.1 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/qri-io/jsonpointer v0.1.1 // indirect github.com/sergi/go-diff v1.3.1 // indirect github.com/skeema/knownhosts v1.2.1 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/vbatts/tar-split v0.11.5 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/yuin/goldmark v1.7.1 // indirect @@ -130,18 +121,17 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.21.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.169.0 // indirect - google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect diff --git a/go.sum b/go.sum index a235f167..f803ac68 100644 --- a/go.sum +++ b/go.sum @@ -68,10 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -196,10 +194,10 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0 github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.12.0-rc.3 h1:5GNGrobGs/sN/0nFO21W9k4lFn+iXXZAE8fCZbmdRak= -github.com/Microsoft/hcsshim v0.12.0-rc.3/go.mod h1:WuNfcaYNaw+KpCEsZCIM6HCEmu0c5HfXpi+dDSmveP0= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.12.3 h1:LS9NXqXhMoqNCplK1ApmVSfB4UnVLRDWRapB6EIlxE0= +github.com/Microsoft/hcsshim v0.12.3/go.mod h1:Iyl1WVpZzr+UkzjekHZbV8o5Z9ZkxNGx6CtY2Qg/JVQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= @@ -262,8 +260,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= -github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= -github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= +github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= +github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= @@ -272,33 +270,34 @@ github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5Z github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containers/image/v5 v5.30.1 h1:AKrQMgOKI1oKx5FW5eoU2xoNyzACajHGx1O3qxobvFM= -github.com/containers/image/v5 v5.30.1/go.mod h1:gSD8MVOyqBspc0ynLsuiMR9qmt8UQ4jpVImjmK0uXfk= +github.com/containers/image/v5 v5.31.0 h1:eDFVlz5XaYICxe9dXpf23htEKvyosgkl62mJlIATXE4= +github.com/containers/image/v5 v5.31.0/go.mod h1:5QfOqSackPkSbF7Qxc1DnVNnPJKQ+KWLkfEfDpK590Q= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= -github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= -github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= -github.com/containers/storage v1.53.0 h1:VSES3C/u1pxjTJIXvLrSmyP7OBtDky04oGu07UvdTEA= -github.com/containers/storage v1.53.0/go.mod h1:pujcoOSc+upx15Jirdkebhtd8uJiLwbSd/mYT6zDJK8= +github.com/containers/ocicrypt v1.1.10 h1:r7UR6o8+lyhkEywetubUUgcKFjOWOaWz8cEBrCPX0ic= +github.com/containers/ocicrypt v1.1.10/go.mod h1:YfzSSr06PTHQwSTUKqDSjish9BeW1E4HUmreluQcMd8= +github.com/containers/storage v1.54.0 h1:xwYAlf6n9OnIlURQLLg3FYHbO74fQ/2W2N6EtQEUM4I= +github.com/containers/storage v1.54.0/go.mod h1:PlMOoinRrBSnhYODLxt4EXl0nmJt+X0kjG0Xdt9fMTw= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6/EsX/6284= -github.com/docker/cli v25.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v26.1.3+incompatible h1:bUpXT/N0kDE3VUHI2r5VMsYQgi38kYuoC0oL9yt3lqc= +github.com/docker/cli v26.1.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= -github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v26.1.3+incompatible h1:lLCzRbrVZrljpVNobJu1J2FHk8V0s4BawoZippkc+xo= +github.com/docker/docker v26.1.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -358,10 +357,10 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/swag v0.22.10 h1:4y86NVn7Z2yYd6pfS4Z+Nyh3aAUL3Nul+LMbhFKy0gA= -github.com/go-openapi/swag v0.22.10/go.mod h1:Cnn8BYtRlx6BNE3DPN86f/xkapGIcLWzh3CLEb4C1jI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= @@ -492,15 +491,10 @@ github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -539,8 +533,8 @@ github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4 github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -567,8 +561,6 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -616,29 +608,30 @@ github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFz github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/powerman/rpc-codec v1.2.2 h1:BK0JScZivljhwW/vLLhZLtUgqSxc/CD3sHEs8LiwwKw= github.com/powerman/rpc-codec v1.2.2/go.mod h1:3Qr/y/+u3CwcSww9tfJMRn/95lB2qUdUeIQe7BYlLDo= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.51.1 h1:eIjN50Bwglz6a/c3hAgSMcofL3nD+nFQkV6Dd4DsQCw= +github.com/prometheus/common v0.51.1/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/qri-io/jsonpointer v0.1.1 h1:prVZBZLL6TW5vsSB9fFHFAMBLI4b0ri5vribQlTJiBA= github.com/qri-io/jsonpointer v0.1.1/go.mod h1:DnJPaYgiKu56EuDp8TU5wFLdZIcAnb/uH9v37ZaMV64= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -682,8 +675,8 @@ github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xz github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8= github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= @@ -740,8 +733,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -752,8 +745,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -781,8 +774,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -836,8 +829,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -863,8 +856,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -880,8 +873,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -957,16 +950,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -976,12 +969,11 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1040,8 +1032,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1109,8 +1101,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_override/test_suite.input b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_override/test_suite.input index 22e07862..f54d9f1b 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_override/test_suite.input +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_override/test_suite.input @@ -1 +1 @@ -kpm run -O __main__:a2.image="new-a2-image:v123" \ No newline at end of file +kpm run -O a2.image="new-a2-image:v123" \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_kpm_run_with_override_profile/kcl.mod b/test/e2e/test_suites/test_data/test_kpm_run_with_override_profile/kcl.mod index f1760e27..20454996 100644 --- a/test/e2e/test_suites/test_data/test_kpm_run_with_override_profile/kcl.mod +++ b/test/e2e/test_suites/test_data/test_kpm_run_with_override_profile/kcl.mod @@ -4,4 +4,4 @@ edition = "0.0.1" version = "0.0.1" [profile] -overrides = [ "__main__:a2.image=\"new-a2-image:v123\"" ] \ No newline at end of file +overrides = [ "a2.image=\"new-a2-image:v123\"" ] \ No newline at end of file From 7d2fbdac62148ee433170a185f79885be3b91269 Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 29 May 2024 11:17:41 +0800 Subject: [PATCH 17/35] chore: add depend bot Signed-off-by: peefy Signed-off-by: d4v1d03 --- .github/dependabot.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..c4941626 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + commit-message: + prefix: "Chore: " + include: "scope" + ignore: + - dependency-name: k8s.io/* + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "chore: " + include: "scope" From 6ee91c0cddcc5ac3765bf4d4edd06b98a899817f Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 29 May 2024 11:27:25 +0800 Subject: [PATCH 18/35] chore: update reference to latest Signed-off-by: peefy Signed-off-by: d4v1d03 --- go.mod | 4 ++-- pkg/utils/utils.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c98afd1c..7d93d1ce 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.21.5 require ( github.com/BurntSushi/toml v1.4.0 github.com/containers/image/v5 v5.31.0 - github.com/docker/distribution v2.8.3+incompatible + github.com/distribution/reference v0.6.0 github.com/dominikbraun/graph v0.23.0 github.com/opencontainers/image-spec v1.1.0 github.com/otiai10/copy v1.14.0 @@ -47,8 +47,8 @@ require ( github.com/containers/storage v1.54.0 // indirect github.com/cyphar/filepath-securejoin v0.2.5 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/distribution/reference v0.6.0 // indirect github.com/docker/cli v26.1.3+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v26.1.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.1 // indirect github.com/docker/go-connections v0.5.0 // indirect diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 77cd615a..64c63609 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -16,7 +16,7 @@ import ( "regexp" "strings" - "github.com/docker/distribution/reference" + "github.com/distribution/reference" "github.com/moby/term" "kcl-lang.io/kpm/pkg/constants" From 8eb58828df077504ac3698ae9a04784b0e4909d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:30:57 +0000 Subject: [PATCH 19/35] chore: (deps): bump contributor-assistant/github-action Bumps [contributor-assistant/github-action](https://github.com/contributor-assistant/github-action) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/contributor-assistant/github-action/releases) - [Commits](https://github.com/contributor-assistant/github-action/compare/v2.3.0...v2.4.0) --- updated-dependencies: - dependency-name: contributor-assistant/github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- .github/workflows/cla.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index f0b5904b..bdeb3cdb 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -10,7 +10,7 @@ jobs: steps: - name: "CLA Assistant" if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@v2.3.0 + uses: contributor-assistant/github-action@v2.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # the below token should have repo scope and must be manually added by you in the repository's secret From 5b68d0a6d26cf52a9b0990e63d4698dc1de3b16b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:31:00 +0000 Subject: [PATCH 20/35] chore: (deps): bump goreleaser/goreleaser-action from 4 to 5 Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5. - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](https://github.com/goreleaser/goreleaser-action/compare/v4...v5) --- updated-dependencies: - dependency-name: goreleaser/goreleaser-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64591565..3b0815e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: with: go-version: 1.21 - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest From b7ee3c8b4ef9a5dd6ba9fda06c7ec3355fcfa36f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:31:02 +0000 Subject: [PATCH 21/35] chore: (deps): bump actions/checkout from 2 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- .github/workflows/e2e-test.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-win.yaml | 2 +- .github/workflows/test.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 5af74d22..5b0ab42c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: install Go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b0815e0..f3269273 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go diff --git a/.github/workflows/test-win.yaml b/.github/workflows/test-win.yaml index ed0ea934..98cd84df 100644 --- a/.github/workflows/test-win.yaml +++ b/.github/workflows/test-win.yaml @@ -13,7 +13,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 522401a1..b43804a0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go 1.21 From 1dc8c21e1ba4e30bcca088c28649c9b1a642afa7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:31:05 +0000 Subject: [PATCH 22/35] chore: (deps): bump actions/setup-go from 2 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- .github/workflows/e2e-test.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-win.yaml | 2 +- .github/workflows/test.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 5b0ab42c..ebc6c86a 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -17,7 +17,7 @@ jobs: with: fetch-depth: 0 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.21 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3269273..40ebff0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.21 - name: Run GoReleaser diff --git a/.github/workflows/test-win.yaml b/.github/workflows/test-win.yaml index 98cd84df..2066c5c2 100644 --- a/.github/workflows/test-win.yaml +++ b/.github/workflows/test-win.yaml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.21 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b43804a0..b6885dd9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go 1.21 - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.21 From e6817a38e9b7fafa314e5d2c5fdd2bc443cf22bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:32:17 +0000 Subject: [PATCH 23/35] Chore: (deps): bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.19.0 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.11.0 to 2.19.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.11.0...v2.19.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- go.mod | 8 ++++---- go.sum | 18 ++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 7d93d1ce..f52fd16a 100644 --- a/go.mod +++ b/go.mod @@ -65,13 +65,13 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/goccy/go-yaml v1.11.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -152,8 +152,8 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/kubescape/go-git-url v0.0.30 github.com/moby/term v0.5.0 - github.com/onsi/ginkgo/v2 v2.11.0 - github.com/onsi/gomega v1.27.10 + github.com/onsi/ginkgo/v2 v2.19.0 + github.com/onsi/gomega v1.33.1 github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/stretchr/testify v1.9.0 github.com/thoas/go-funk v0.9.3 diff --git a/go.sum b/go.sum index f803ac68..c75be64f 100644 --- a/go.sum +++ b/go.sum @@ -368,8 +368,8 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/goccy/go-yaml v1.11.3 h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I= @@ -460,8 +460,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -507,7 +507,6 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= @@ -585,10 +584,10 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -926,7 +925,6 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From c8229aa625d8f69e5808e6f9b85fbbc839609094 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:32:45 +0000 Subject: [PATCH 24/35] Chore: (deps): bump github.com/go-git/go-git/v5 from 5.11.0 to 5.12.0 Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.11.0...v5.12.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- go.mod | 8 ++++---- go.sum | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index f52fd16a..e8b02578 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/hcsshim v0.12.3 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/aws/aws-sdk-go v1.44.122 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -108,8 +108,8 @@ require ( github.com/prometheus/common v0.51.1 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/qri-io/jsonpointer v0.1.1 // indirect - github.com/sergi/go-diff v1.3.1 // indirect - github.com/skeema/knownhosts v1.2.1 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect + github.com/skeema/knownhosts v1.2.2 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/ulikunitz/xz v0.5.12 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect @@ -144,7 +144,7 @@ require ( require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/go-git/go-git/v5 v5.11.0 + github.com/go-git/go-git/v5 v5.12.0 github.com/gofrs/flock v0.8.1 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/hashicorp/go-cleanhttp v0.5.2 // indirect diff --git a/go.sum b/go.sum index c75be64f..b1f38d63 100644 --- a/go.sum +++ b/go.sum @@ -199,8 +199,8 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA github.com/Microsoft/hcsshim v0.12.3 h1:LS9NXqXhMoqNCplK1ApmVSfB4UnVLRDWRapB6EIlxE0= github.com/Microsoft/hcsshim v0.12.3/go.mod h1:Iyl1WVpZzr+UkzjekHZbV8o5Z9ZkxNGx6CtY2Qg/JVQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= +github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -336,16 +336,16 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= +github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= -github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -639,14 +639,14 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= From eaee13432f27f14cf7de73314eb0465816cbcb3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 03:37:32 +0000 Subject: [PATCH 25/35] Chore: (deps): bump github.com/hashicorp/go-version from 1.6.0 to 1.7.0 Bumps [github.com/hashicorp/go-version](https://github.com/hashicorp/go-version) from 1.6.0 to 1.7.0. - [Release notes](https://github.com/hashicorp/go-version/releases) - [Changelog](https://github.com/hashicorp/go-version/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-version/compare/v1.6.0...v1.7.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-version dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: d4v1d03 --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e8b02578..4a20b39e 100644 --- a/go.mod +++ b/go.mod @@ -149,7 +149,7 @@ require ( github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.4 - github.com/hashicorp/go-version v1.6.0 + github.com/hashicorp/go-version v1.7.0 github.com/kubescape/go-git-url v0.0.30 github.com/moby/term v0.5.0 github.com/onsi/ginkgo/v2 v2.19.0 diff --git a/go.sum b/go.sum index b1f38d63..cc050218 100644 --- a/go.sum +++ b/go.sum @@ -497,8 +497,9 @@ github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWS github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= From 5441529d0b6c7c4a12331e46ddc7f87022002263 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Wed, 29 May 2024 13:10:50 +0530 Subject: [PATCH 26/35] reverted the useless changes Signed-off-by: d4v1d03 Signed-off-by: d4v1d03 --- pkg/package/modfile.go | 62 +----------------------------------------- pkg/package/toml.go | 8 ++++++ 2 files changed, 9 insertions(+), 61 deletions(-) diff --git a/pkg/package/modfile.go b/pkg/package/modfile.go index c8a13553..261f67d9 100644 --- a/pkg/package/modfile.go +++ b/pkg/package/modfile.go @@ -2,14 +2,11 @@ package pkg import ( - "bytes" "errors" "fmt" "net/url" "os" - "io" "path/filepath" - "sort" "strings" "github.com/BurntSushi/toml" @@ -437,15 +434,11 @@ func LoadLockDeps(homePath string) (*Dependencies, error) { } // Write the contents of 'ModFile' to 'kcl.mod' file -// StoreModFile writes the contents of 'ModFile' to 'kcl.mod' file. -// It uses an ordered dictionary for serialization/deserialization to preserve the order of dependencies. func (mfile *ModFile) StoreModFile() error { fullPath := filepath.Join(mfile.HomePath, MOD_FILE) - tomlContent := mfile.MarshalTOML() - return utils.StoreToFile(fullPath, tomlContent) + return utils.StoreToFile(fullPath, mfile.MarshalTOML()) } - // Returns the path to the kcl.mod file func (mfile *ModFile) GetModFilePath() string { return filepath.Join(mfile.HomePath, MOD_FILE) @@ -621,56 +614,3 @@ func ParseRepoFullNameFromGitSource(gitSrc Git) (string, error) { func ParseRepoNameFromGitSource(gitSrc Git) string { return utils.ParseRepoNameFromGitUrl(gitSrc.Url) } - -// SortMapByKey will sort the dependencies by key. -func (deps *Dependencies) SortMapByKey() { - keys := make([]string, 0, len(deps.Deps)) - for k := range deps.Deps { - keys = append(keys, k) - } - sort.Strings(keys) - - sortedDeps := make(map[string]Dependency) - for _, k := range keys { - sortedDeps[k] = deps.Deps[k] - } - deps.Deps = sortedDeps -} - -// StoreModFile writes the contents of 'ModFile' to 'kcl.mod' file. -// It uses an ordered dictionary for serialization/deserialization to preserve the order of dependencies. -type OrderedTomlEncoder struct { - Encoder *toml.Encoder - Writer io.Writer -} - -// NewOrderedTomlEncoder creates a new instance of OrderedTomlEncoder. -func NewOrderedTomlEncoder(buf *bytes.Buffer) *OrderedTomlEncoder { - return &OrderedTomlEncoder{ - Encoder: toml.NewEncoder(buf), - } -} - -// Encode encodes the given value into TOML format while maintaining the field order. -func (ote *OrderedTomlEncoder) Encode(v interface{}) error { - buf := new(bytes.Buffer) - ote.Encoder.Indent = "" - err := ote.Encoder.Encode(v) - if err != nil { - return err - } - _, err = buf.WriteTo(ote.Writer) - return err -} - -// MarshalTOML marshals the ModFile to TOML format using an ordered dictionary. -func (mfile *ModFile) MarshalTOML() (string) { - buf := new(bytes.Buffer) - enc := NewOrderedTomlEncoder(buf) - err := enc.Encode(mfile) - if err != nil { - return "" - } - return buf.String() -} - diff --git a/pkg/package/toml.go b/pkg/package/toml.go index 94e5e75a..230c79a4 100644 --- a/pkg/package/toml.go +++ b/pkg/package/toml.go @@ -33,6 +33,14 @@ import ( const NEWLINE = "\n" +func (mod *ModFile) MarshalTOML() string { + var sb strings.Builder + sb.WriteString(mod.Pkg.MarshalTOML()) + sb.WriteString(mod.Dependencies.MarshalTOML()) + sb.WriteString(mod.Profiles.MarshalTOML()) + return sb.String() +} + const PACKAGE_PATTERN = "[package]" func (pkg *Package) MarshalTOML() string { From 87b329979d848988bfd5b8398954fef3adbadd51 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Wed, 29 May 2024 15:35:30 +0530 Subject: [PATCH 27/35] fix in doc Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 21 +++++++++++++++++++-- scripts/scripts/registry_auth/htpasswd | 0 2 files changed, 19 insertions(+), 2 deletions(-) delete mode 100644 scripts/scripts/registry_auth/htpasswd diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index b94c7ca0..968787a1 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -6,6 +6,7 @@ kpm which is the package management tool for KCL, does not support sparse-checko ## 2. User Worklow - Adding a Subdirectory Dependency via Command Line - Specifying a Subdirectory in `kcl.mod` +- Adding a Subdirectory Dependency via Configuration File ## 3. Command Line Inteface We will try to keep the command line interface as simple and straightforward as possible for adding a Git repository subdirectory as a dependency. The below steps show how a user can use the feature: @@ -16,6 +17,9 @@ The following command will lead to the addition of a dependency: This command will add the specified subdirectory as a dependency in the current KCL project. +- Non-interactive Method : +In addition to the command line interface, users can specify subdirectory dependencies directly in the `kcl.mod` file, which can be particularly useful for automated environments. + ## 4. Example Use-case Considering the nginx-ingres module, on typing the command @@ -25,8 +29,21 @@ kpm add https://github.com/kcl-lang/modules/tree/main/nginx-ingress /restrict-in The following command will lead to the addition of restrict-ingress-anotations package to the current KCL project and will update the kcl.mod accordingly. +Alternatively, for non-interactive environments, users can directly edit the `kcl.mod` file: +``` +[package] +name = "test" +edition = "v0.9.0" +version = "0.0.1" + +[dependencies] +my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } + +``` + ## 5. Specifying how kcl.mod will specify the added subdirectories -To support the specification of a subdirectory for dependencies that are sourced from Git repositories, we need to extend the kcl.mod file structure. This involves adding an optional `subdirectory` field under each dependency. +To support the specification of a subdirectory for dependencies that are sourced from Git repositories, we need to extend the kcl.mod file structure. This involves adding an optional `subdirectory` field under each dependency. This can be manually edited or automatically updated by the kpm add command. + A sample kcl mod for the same would look like this. ``` @@ -55,4 +72,4 @@ if err != nil { ``` ## 7. Conclusion -By extending the kcl.mod file to include a subdirectory field for Git-based dependencies, users can now specify and manage dependencies that reside in specific subdirectories of a Git repository. This enhancement will enable kpm to download only the necessary parts of large repositories, significantly improving performance when dealing with monorepos. The user interface remains intuitive, and the implementation leverages Git's sparse-checkout feature to achieve the desired functionality. \ No newline at end of file +By extending the kcl.mod file to include a subdirectory field for Git-based dependencies, users can now specify and manage dependencies that reside in specific subdirectories of a Git repository. This enhancement will enable kpm to download only the necessary parts of large repositories, significantly improving performance when dealing with monorepos. The user interface remains intuitive, and the implementation leverages Git's sparse-checkout feature to achieve the desired functionality even when used in automated CI/CD pipelines. \ No newline at end of file diff --git a/scripts/scripts/registry_auth/htpasswd b/scripts/scripts/registry_auth/htpasswd deleted file mode 100644 index e69de29b..00000000 From bcb0a8e3e34cad4b1533260f3f2e2c59a1c36eea Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Wed, 29 May 2024 15:44:36 +0530 Subject: [PATCH 28/35] minor changes regarding the deprecated kpm Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index 968787a1..d4b15de9 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -13,7 +13,7 @@ We will try to keep the command line interface as simple and straightforward as - Adding a Dependency : The following command will lead to the addition of a dependency: -`kpm add ` +`kcl mod add ` This command will add the specified subdirectory as a dependency in the current KCL project. @@ -24,7 +24,7 @@ In addition to the command line interface, users can specify subdirectory depend Considering the nginx-ingres module, on typing the command ``` -kpm add https://github.com/kcl-lang/modules/tree/main/nginx-ingress /restrict-ingress-anotations +kcl mod add https://github.com/kcl-lang/modules/tree/main/nginx-ingress /restrict-ingress-anotations ``` The following command will lead to the addition of restrict-ingress-anotations package to the current KCL project and will update the kcl.mod accordingly. @@ -42,7 +42,7 @@ my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/ ``` ## 5. Specifying how kcl.mod will specify the added subdirectories -To support the specification of a subdirectory for dependencies that are sourced from Git repositories, we need to extend the kcl.mod file structure. This involves adding an optional `subdirectory` field under each dependency. This can be manually edited or automatically updated by the kpm add command. +To support the specification of a subdirectory for dependencies that are sourced from Git repositories, we need to extend the kcl.mod file structure. This involves adding an optional `subdirectory` field under each dependency. This can be manually edited or automatically updated by the kcl mod add command. A sample kcl mod for the same would look like this. From eb5492a3a3c51293ff52beb4b31489dbb3e7b8d2 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Thu, 30 May 2024 05:30:07 +0530 Subject: [PATCH 29/35] downloader pattern implemented with test added Signed-off-by: d4v1d03 --- pkg/client/client.go | 7 +++++- pkg/downloader/downloader_test.go | 42 ++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index dda5f26a..a6820db5 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -918,7 +918,12 @@ func (c *KpmClient) AcquireTheLatestOciVersion(ociSource pkg.Oci) (string, error // Download will download the dependency to the local path. func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*pkg.Dependency, error) { if dep.Source.Git != nil { - _, err := c.DownloadFromGit(dep.Source.Git, localPath) + err := c.DepDownloader.Download(*downloader.NewDownloadOptions( + downloader.WithLocalPath(localPath), + downloader.WithSource(dep.Source), + downloader.WithLogWriter(c.logWriter), + downloader.WithSettings(c.settings), + )) if err != nil { return nil, err } diff --git a/pkg/downloader/downloader_test.go b/pkg/downloader/downloader_test.go index 8f0e3652..46b94276 100644 --- a/pkg/downloader/downloader_test.go +++ b/pkg/downloader/downloader_test.go @@ -21,17 +21,20 @@ func getTestDir(subDir string) string { } func TestOciDownloader(t *testing.T) { - path := getTestDir("test_oci") + ociTestDir := getTestDir("oci_test_dir") + if err := os.MkdirAll(ociTestDir, os.ModePerm); err != nil { + t.Fatal(err) + } defer func() { - _ = os.RemoveAll(path) + _ = os.RemoveAll(ociTestDir) }() - ociDownloader := OciDownloader{ + downloader := OciDownloader{ Platform: "linux/amd64", } - err := ociDownloader.Download(*NewDownloadOptions( + options := NewDownloadOptions( WithSource(pkg.Source{ Oci: &pkg.Oci{ Reg: "ghcr.io", @@ -39,9 +42,36 @@ func TestOciDownloader(t *testing.T) { Tag: "0.0.3", }, }), - WithLocalPath(path), + WithLocalPath(ociTestDir), + ) + + err := downloader.Download(*options) + + assert.Equal(t, err, nil) + assert.Equal(t, true, utils.DirExists(filepath.Join(ociTestDir, "artifact.tgz"))) + + gitTestDir := getTestDir("git_test_dir") + if err := os.MkdirAll(gitTestDir, os.ModePerm); err != nil { + t.Fatal(err) + } + + defer func() { + _ = os.RemoveAll(gitTestDir) + }() + + gitDownloader := GitDownloader{} + + err = gitDownloader.Download(*NewDownloadOptions( + WithSource(pkg.Source{ + Git: &pkg.Git{ + Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", + Commit: "ade147b", + }, + }), + WithLocalPath(gitTestDir), )) assert.Equal(t, err, nil) - assert.Equal(t, true, utils.DirExists(filepath.Join(path, "artifact.tgz"))) + assert.Equal(t, false, utils.DirExists(filepath.Join(gitTestDir, "some_expected_file"))) } + From ab10bdc6f3a7aaf6fdc29a4a9df0516f5d7f1a1f Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Thu, 30 May 2024 05:34:05 +0530 Subject: [PATCH 30/35] Revert "downloader pattern implemented with test added" This reverts commit 78e34fcfe1b5b86fd1a07a2cc34f14f4cad2a661. Signed-off-by: d4v1d03 --- pkg/client/client.go | 7 +----- pkg/downloader/downloader_test.go | 42 +++++-------------------------- 2 files changed, 7 insertions(+), 42 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index a6820db5..dda5f26a 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -918,12 +918,7 @@ func (c *KpmClient) AcquireTheLatestOciVersion(ociSource pkg.Oci) (string, error // Download will download the dependency to the local path. func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*pkg.Dependency, error) { if dep.Source.Git != nil { - err := c.DepDownloader.Download(*downloader.NewDownloadOptions( - downloader.WithLocalPath(localPath), - downloader.WithSource(dep.Source), - downloader.WithLogWriter(c.logWriter), - downloader.WithSettings(c.settings), - )) + _, err := c.DownloadFromGit(dep.Source.Git, localPath) if err != nil { return nil, err } diff --git a/pkg/downloader/downloader_test.go b/pkg/downloader/downloader_test.go index 46b94276..8f0e3652 100644 --- a/pkg/downloader/downloader_test.go +++ b/pkg/downloader/downloader_test.go @@ -21,20 +21,17 @@ func getTestDir(subDir string) string { } func TestOciDownloader(t *testing.T) { - ociTestDir := getTestDir("oci_test_dir") - if err := os.MkdirAll(ociTestDir, os.ModePerm); err != nil { - t.Fatal(err) - } + path := getTestDir("test_oci") defer func() { - _ = os.RemoveAll(ociTestDir) + _ = os.RemoveAll(path) }() - downloader := OciDownloader{ + ociDownloader := OciDownloader{ Platform: "linux/amd64", } - options := NewDownloadOptions( + err := ociDownloader.Download(*NewDownloadOptions( WithSource(pkg.Source{ Oci: &pkg.Oci{ Reg: "ghcr.io", @@ -42,36 +39,9 @@ func TestOciDownloader(t *testing.T) { Tag: "0.0.3", }, }), - WithLocalPath(ociTestDir), - ) - - err := downloader.Download(*options) - - assert.Equal(t, err, nil) - assert.Equal(t, true, utils.DirExists(filepath.Join(ociTestDir, "artifact.tgz"))) - - gitTestDir := getTestDir("git_test_dir") - if err := os.MkdirAll(gitTestDir, os.ModePerm); err != nil { - t.Fatal(err) - } - - defer func() { - _ = os.RemoveAll(gitTestDir) - }() - - gitDownloader := GitDownloader{} - - err = gitDownloader.Download(*NewDownloadOptions( - WithSource(pkg.Source{ - Git: &pkg.Git{ - Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", - Commit: "ade147b", - }, - }), - WithLocalPath(gitTestDir), + WithLocalPath(path), )) assert.Equal(t, err, nil) - assert.Equal(t, false, utils.DirExists(filepath.Join(gitTestDir, "some_expected_file"))) + assert.Equal(t, true, utils.DirExists(filepath.Join(path, "artifact.tgz"))) } - From 208e9f5b4ce2934aa533a910d24e6f1d4ae87da0 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Fri, 31 May 2024 02:31:09 +0530 Subject: [PATCH 31/35] fixed DCO and committed doc final Signed-off-by: d4v1d03 --- docs/kpm_sparse_checkout.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index d4b15de9..fe87cd54 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -37,7 +37,7 @@ edition = "v0.9.0" version = "0.0.1" [dependencies] -my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } +my_dependency = { git = "https://github.com/example/repo/path/to/package" } ``` @@ -53,7 +53,7 @@ edition = "v0.9.0" version = "0.0.1" [dependencies] -my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } +my_dependency = { git = "https://github.com/example/repo/path/to/package" } ``` ## 6. Integration and the use of go-getter to download the specific subdirectories From 8db93edc9574b98aa5c6f45eb3ce251b1ab743d0 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Fri, 31 May 2024 02:59:08 +0530 Subject: [PATCH 32/35] fixed failing test pkg/version Signed-off-by: d4v1d03 --- pkg/client/client_test.go | 2 +- pkg/downloader/downloader.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index d63e270e..d4803b7d 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -50,7 +50,7 @@ func initTestDir(subDir string) string { return testDir } -// TestDownloadGit test download from oci registry. +// TestDownloadOci test download from oci registry. func TestDownloadOci(t *testing.T) { testPath := filepath.Join(getTestDir("download"), "helloworld_0.1.2") err := os.MkdirAll(testPath, 0755) diff --git a/pkg/downloader/downloader.go b/pkg/downloader/downloader.go index 24a17125..e0b4a4a5 100644 --- a/pkg/downloader/downloader.go +++ b/pkg/downloader/downloader.go @@ -4,10 +4,8 @@ import ( "errors" "fmt" "io" - "path/filepath" v1 "github.com/opencontainers/image-spec/specs-go/v1" - "kcl-lang.io/kpm/pkg/constants" "kcl-lang.io/kpm/pkg/git" "kcl-lang.io/kpm/pkg/oci" pkg "kcl-lang.io/kpm/pkg/package" @@ -170,7 +168,7 @@ func (d *GitDownloader) Download(opts DownloadOptions) error { git.WithBranch(gitSource.Branch), git.WithTag(gitSource.Tag), git.WithRepoURL(gitSource.Url), - git.WithLocalPath(filepath.Join(opts.LocalPath, constants.GitEntry)), + git.WithLocalPath(opts.LocalPath), ) if err != nil { From 09f16da7749e7ae55a69e89e9f7f3679186f53cc Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Fri, 31 May 2024 03:00:59 +0530 Subject: [PATCH 33/35] Revert "fixed DCO and committed doc final" This reverts commit 208e9f5b4ce2934aa533a910d24e6f1d4ae87da0. --- docs/kpm_sparse_checkout.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/kpm_sparse_checkout.md b/docs/kpm_sparse_checkout.md index fe87cd54..d4b15de9 100644 --- a/docs/kpm_sparse_checkout.md +++ b/docs/kpm_sparse_checkout.md @@ -37,7 +37,7 @@ edition = "v0.9.0" version = "0.0.1" [dependencies] -my_dependency = { git = "https://github.com/example/repo/path/to/package" } +my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } ``` @@ -53,7 +53,7 @@ edition = "v0.9.0" version = "0.0.1" [dependencies] -my_dependency = { git = "https://github.com/example/repo/path/to/package" } +my_dependency = { git = "https://github.com/example/repo", subdirectory = "path/to/package" } ``` ## 6. Integration and the use of go-getter to download the specific subdirectories From 512037a1a26edf8e69b357af8148a5a2a40090d9 Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Tue, 4 Jun 2024 04:42:07 +0530 Subject: [PATCH 34/35] seperated tests --- pkg/downloader/downloader_test.go | 83 ++++++++++++++++--------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/pkg/downloader/downloader_test.go b/pkg/downloader/downloader_test.go index bc16d845..9bb1fddb 100644 --- a/pkg/downloader/downloader_test.go +++ b/pkg/downloader/downloader_test.go @@ -21,53 +21,56 @@ func getTestDir(subDir string) string { } func TestOciDownloader(t *testing.T) { - path_oci := getTestDir("test_oci") - if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { - t.Fatal(err) - } + path_oci := getTestDir("test_oci") + if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { + t.Fatal(err) + } - defer func() { - _ = os.RemoveAll(path_oci) - }() + defer func() { + _ = os.RemoveAll(path_oci) + }() - ociDownloader := OciDownloader{ - Platform: "linux/amd64", - } + ociDownloader := OciDownloader{ + Platform: "linux/amd64", + } - err := ociDownloader.Download(*NewDownloadOptions( - WithSource(pkg.Source{ - Oci: &pkg.Oci{ - Reg: "ghcr.io", - Repo: "zong-zhe/helloworld", - Tag: "0.0.3", - }, - }), - WithLocalPath(path_oci), - )) + err := ociDownloader.Download(*NewDownloadOptions( + WithSource(pkg.Source{ + Oci: &pkg.Oci{ + Reg: "ghcr.io", + Repo: "zong-zhe/helloworld", + Tag: "0.0.3", + }, + }), + WithLocalPath(path_oci), + )) - assert.Equal(t, err, nil) - assert.Equal(t, true, utils.DirExists(filepath.Join(path_oci, "artifact.tgz"))) + assert.Equal(t, err, nil) + assert.Equal(t, true, utils.DirExists(filepath.Join(path_oci, "artifact.tgz"))) +} - path_git := getTestDir("test_git") - if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { - t.Fatal(err) - } +func TestGitDownloader(t *testing.T) { + path_git := getTestDir("test_git") + if err := os.MkdirAll(path_git, os.ModePerm); err != nil { + t.Fatal(err) + } - defer func() { - _ = os.RemoveAll(path_git) - }() + defer func() { + _ = os.RemoveAll(path_git) + }() - gitDownloader := GitDownloader{} + gitDownloader := GitDownloader{} - err = gitDownloader.Download(*NewDownloadOptions( - WithSource(pkg.Source{ - Git: &pkg.Git{ - Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", - Commit: "ade147b", - }, - }), - WithLocalPath(path_git), - )) + err := gitDownloader.Download(*NewDownloadOptions( + WithSource(pkg.Source{ + Git: &pkg.Git{ + Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", + Commit: "ade147b", + }, + }), + WithLocalPath(path_git), + )) - assert.Equal(t, err, nil) + assert.Equal(t, err, nil) + assert.Equal(t, true, utils.DirExists(filepath.Join(path_git, "flask-demo-kcl-manifests"))) } From 003f931d37d643ad81f0223f267f302eea446c1f Mon Sep 17 00:00:00 2001 From: d4v1d03 Date: Tue, 4 Jun 2024 04:46:44 +0530 Subject: [PATCH 35/35] Revert "seperated tests" This reverts commit 512037a1a26edf8e69b357af8148a5a2a40090d9. --- pkg/downloader/downloader_test.go | 83 +++++++++++++++---------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/pkg/downloader/downloader_test.go b/pkg/downloader/downloader_test.go index 9bb1fddb..bc16d845 100644 --- a/pkg/downloader/downloader_test.go +++ b/pkg/downloader/downloader_test.go @@ -21,56 +21,53 @@ func getTestDir(subDir string) string { } func TestOciDownloader(t *testing.T) { - path_oci := getTestDir("test_oci") - if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { - t.Fatal(err) - } + path_oci := getTestDir("test_oci") + if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { + t.Fatal(err) + } - defer func() { - _ = os.RemoveAll(path_oci) - }() + defer func() { + _ = os.RemoveAll(path_oci) + }() - ociDownloader := OciDownloader{ - Platform: "linux/amd64", - } + ociDownloader := OciDownloader{ + Platform: "linux/amd64", + } - err := ociDownloader.Download(*NewDownloadOptions( - WithSource(pkg.Source{ - Oci: &pkg.Oci{ - Reg: "ghcr.io", - Repo: "zong-zhe/helloworld", - Tag: "0.0.3", - }, - }), - WithLocalPath(path_oci), - )) + err := ociDownloader.Download(*NewDownloadOptions( + WithSource(pkg.Source{ + Oci: &pkg.Oci{ + Reg: "ghcr.io", + Repo: "zong-zhe/helloworld", + Tag: "0.0.3", + }, + }), + WithLocalPath(path_oci), + )) - assert.Equal(t, err, nil) - assert.Equal(t, true, utils.DirExists(filepath.Join(path_oci, "artifact.tgz"))) -} + assert.Equal(t, err, nil) + assert.Equal(t, true, utils.DirExists(filepath.Join(path_oci, "artifact.tgz"))) -func TestGitDownloader(t *testing.T) { - path_git := getTestDir("test_git") - if err := os.MkdirAll(path_git, os.ModePerm); err != nil { - t.Fatal(err) - } + path_git := getTestDir("test_git") + if err := os.MkdirAll(path_oci, os.ModePerm); err != nil { + t.Fatal(err) + } - defer func() { - _ = os.RemoveAll(path_git) - }() + defer func() { + _ = os.RemoveAll(path_git) + }() - gitDownloader := GitDownloader{} + gitDownloader := GitDownloader{} - err := gitDownloader.Download(*NewDownloadOptions( - WithSource(pkg.Source{ - Git: &pkg.Git{ - Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", - Commit: "ade147b", - }, - }), - WithLocalPath(path_git), - )) + err = gitDownloader.Download(*NewDownloadOptions( + WithSource(pkg.Source{ + Git: &pkg.Git{ + Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", + Commit: "ade147b", + }, + }), + WithLocalPath(path_git), + )) - assert.Equal(t, err, nil) - assert.Equal(t, true, utils.DirExists(filepath.Join(path_git, "flask-demo-kcl-manifests"))) + assert.Equal(t, err, nil) }