Skip to content

Commit

Permalink
Merge pull request #314 from zong-zhe/rm-calculation-sum
Browse files Browse the repository at this point in the history
feat: the checksum calculation during compilation is removed
  • Loading branch information
Peefy committed May 23, 2024
2 parents 0b0b423 + 66a5cf6 commit aa19024
Show file tree
Hide file tree
Showing 111 changed files with 503 additions and 401 deletions.
6 changes: 3 additions & 3 deletions pkg/3rdparty/mvs/mvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
have[m] = true
for _, m1 := range reqCache[m] {
walk(m1)
_ = walk(m1)
}
return nil
}
Expand All @@ -249,7 +249,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
m := module.Version{Path: path, Version: max[path]}
min = append(min, m)
walk(m)
_ = walk(m)
haveBase[path] = true
}
// Now the reverse postorder to bring in anything else.
Expand All @@ -261,7 +261,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
if !have[m] {
min = append(min, m)
walk(m)
_ = walk(m)
}
}
sort.Slice(min, func(i, j int) bool {
Expand Down
1 change: 0 additions & 1 deletion pkg/api/kpm_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func TestPackageApi(t *testing.T) {
assert.Equal(t, dep.Name, "k8s")
assert.Equal(t, dep.FullName, "k8s_1.27")
assert.Equal(t, dep.Version, "1.27")
assert.Equal(t, dep.Sum, "xnYM1FWHAy3m+KcQMQb2rjZouTxumqYt6FGZpu2T4yM=")
assert.Equal(t, dep.Source.Oci.Reg, "ghcr.io")
assert.Equal(t, dep.Source.Oci.Repo, "kcl-lang/k8s")
assert.Equal(t, dep.Source.Oci.Tag, "1.27")
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/kpm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"kcl-lang.io/kpm/pkg/errors"
"kcl-lang.io/kpm/pkg/oci"
"kcl-lang.io/kpm/pkg/opt"
pkg "kcl-lang.io/kpm/pkg/package"
"kcl-lang.io/kpm/pkg/reporter"
"kcl-lang.io/kpm/pkg/runner"
"kcl-lang.io/kpm/pkg/utils"
Expand Down Expand Up @@ -242,7 +241,7 @@ func run(kpmcli *client.KpmClient, opts *opt.CompileOptions) (*kcl.KCLResultList
return nil, reporter.NewErrorEvent(reporter.Bug, err, "internal bugs, please contact us to fix it.")
}

kclPkg, err := pkg.LoadKclPkg(pkgPath)
kclPkg, err := kpmcli.LoadPkgFromPath(pkgPath)
if err != nil {
return nil, err
}
Expand Down
37 changes: 17 additions & 20 deletions pkg/api/test_data/test_run_pkg_in_path/expected
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
demo:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:1.14.2
name: nginx
ports:
- containerPort: 80
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
2 changes: 1 addition & 1 deletion pkg/api/test_data/test_run_pkg_in_path/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"demo": {"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "nginx-deployment"}, "spec": {"replicas": 3, "selector": {"matchLabels": {"app": "nginx"}}, "template": {"metadata": {"labels": {"app": "nginx"}}, "spec": {"containers": [{"image": "nginx:1.14.2", "name": "nginx", "ports": [{"containerPort": 80}]}]}}}}}
{"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}]}}}}
2 changes: 1 addition & 1 deletion pkg/api/test_data/test_run_pkg_in_path/test_kcl/kcl.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "0.0.1"
version = "0.0.1"

[dependencies]
konfig = { git = "https://github.com/awesome-kusion/konfig.git", tag = "v0.0.1" }
flask-demo-kcl-manifests = { git = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", commit = "ade147b" }
13 changes: 6 additions & 7 deletions pkg/api/test_data/test_run_pkg_in_path/test_kcl/kcl.mod.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[dependencies]
[dependencies.konfig]
name = "konfig"
full_name = "konfig_v0.0.1"
version = "v0.0.1"
sum = "XFvHdBAoY/+qpJWmj8cjwOwZO8a3nX/7SE35cTxQOFU="
url = "https://github.com/awesome-kusion/konfig.git"
git_tag = "v0.0.1"
[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"
commit = "ade147b"
4 changes: 2 additions & 2 deletions pkg/api/test_data/test_run_pkg_in_path/test_kcl/main.k
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import konfig.base.examples.native.nginx_deployment as nd
import flask_demo_kcl_manifests as flask

demo = nd.demo
a = flask.config
37 changes: 17 additions & 20 deletions pkg/api/test_data/test_run_tar_in_path/expected
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
demo:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:1.14.2
name: nginx
ports:
- containerPort: 80
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
2 changes: 1 addition & 1 deletion pkg/api/test_data/test_run_tar_in_path/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"demo": {"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "nginx-deployment"}, "spec": {"replicas": 3, "selector": {"matchLabels": {"app": "nginx"}}, "template": {"metadata": {"labels": {"app": "nginx"}}, "spec": {"containers": [{"image": "nginx:1.14.2", "name": "nginx", "ports": [{"containerPort": 80}]}]}}}}}
{"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}]}}}}
Binary file modified pkg/api/test_data/test_run_tar_in_path/test.tar
Binary file not shown.
Loading

0 comments on commit aa19024

Please sign in to comment.