Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
  • Loading branch information
AkashKumar7902 committed Feb 20, 2024
1 parent fe8a344 commit 6071084
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,8 @@ func (c *KpmClient) downloadDeps(deps pkg.Dependencies, lockDeps pkg.Dependencie
}
return nil, err
}

source := fmt.Sprintf("%s@%s", d.Name, d.Version)
source = strings.TrimRight(source, "@")
err = depGraph.AddVertex(source)
if err != nil && err != graph.ErrVertexAlreadyExists {
return nil, err
Expand All @@ -1224,7 +1224,7 @@ func (c *KpmClient) downloadDeps(deps pkg.Dependencies, lockDeps pkg.Dependencie
return nil, reporter.NewErrorEvent(
reporter.CircularDependencyExist,
nil,
"adding dependencies results in a cycle",
fmt.Sprintf("adding %s as a dependency results in a cycle", source),
)
}
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestCyclicDependency(t *testing.T) {

_, _, err = kpmcli.InitGraphAndDownloadDeps(kclPkg)
assert.Equal(t, err, reporter.NewErrorEvent(
reporter.CircularDependencyExist, nil, "adding dependencies results in a cycle",
reporter.CircularDependencyExist, nil, "adding bbb as a dependency results in a cycle",
))

err = os.Chdir(currentDir)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
adding dependency 'kcl1'
the lastest version '0.0.1' will be added
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
adding dependencies results in a cycle
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
the lastest version '0.0.1' will be added
downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ the lastest version '0.0.1' will be added
downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<un_ordered>adding dependency 'a_kcl_pkg_dep_pkg_name'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<un_ordered>adding dependency 'a_kcl_pkg_dep_pkg_name'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<un_ordered>adding dependency 'a_kcl_pkg_dep_pkg_name'
downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'
downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'
adding dependencies results in a cycle
downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'

0 comments on commit 6071084

Please sign in to comment.