Skip to content

Commit

Permalink
Merge pull request #140 from zong-zhe/feat-add-diagnostic
Browse files Browse the repository at this point in the history
feat: support flag when add oci ref
  • Loading branch information
Peefy authored Aug 28, 2024
2 parents d174d9c + 90f64bd commit fb9366b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cmd/kcl/commands/mod_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ func parseAddOptions(cli *client.KpmClient, localPath string, args []string) (*o
regOpt.Git.Branch = branch
} else if regOpt.Oci != nil && len(tag) != 0 {
regOpt.Oci.Tag = tag
} else if regOpt.Registry != nil && len(tag) != 0 {
if regOpt.Registry.Tag == "" {
regOpt.Registry.Tag = tag
}
}

return &opt.AddOptions{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/containers/image/v5 v5.32.1 // indirect
github.com/containers/image/v5 v5.32.2 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.2.0 // indirect
github.com/containers/storage v1.55.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
github.com/containers/image/v5 v5.32.1 h1:fVa7GxRC4BCPGsfSRs4JY12WyeY26SUYQ0NuANaCFrI=
github.com/containers/image/v5 v5.32.1/go.mod h1:v1l73VeMugfj/QtKI+jhYbwnwFCFnNGckvbST3rQ5Hk=
github.com/containers/image/v5 v5.32.2 h1:SzNE2Y6sf9b1GJoC8qjCuMBXwQrACFp4p0RK15+4gmQ=
github.com/containers/image/v5 v5.32.2/go.mod h1:v1l73VeMugfj/QtKI+jhYbwnwFCFnNGckvbST3rQ5Hk=
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.2.0 h1:X14EgRK3xNFvJEfI5O4Qn4T3E25ANudSOZz/sirVuPM=
Expand Down
1 change: 1 addition & 0 deletions test/e2e/test_suites/test_add_oci_ref_tag/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kcl mod add helloworld --tag 0.1.1
Empty file.
1 change: 1 addition & 0 deletions test/e2e/test_suites/test_add_oci_ref_tag/stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add dependency 'helloworld:0.1.1' successfully
6 changes: 6 additions & 0 deletions test/e2e/test_suites/test_add_oci_ref_tag/test_space/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "test_space"
edition = "v0.9.0"
version = "0.0.1"


Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The_first_kcl_program = 'Hello World!'

0 comments on commit fb9366b

Please sign in to comment.