-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix update bug when the dependency is from local path
Signed-off-by: zongz <zongzhe1024@163.com>
- Loading branch information
Showing
17 changed files
with
215 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/e2e/test_suites/kpm/kpm_update/test_update_with_all/test_suite.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
KPM_HOME="" | ||
KCLVM_VENDOR_HOME="" |
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/kpm/kpm_update/test_update_with_all/test_suite.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kpm update |
Empty file.
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/kpm/kpm_update/test_update_with_all/test_suite.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
9 changes: 9 additions & 0 deletions
9
test/e2e/test_suites/test_data/test_update_with_all/test_update/kcl.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "test_update" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
test_update_1 = { path = "./../test_update_1" } | ||
helloworld = "0.1.1" | ||
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.1" } |
Empty file.
114 changes: 114 additions & 0 deletions
114
test/e2e/test_suites/test_data/test_update_with_all/test_update/main.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import catalog.models.schema.v1 as ac | ||
import catalog.models.schema.v1.trait as t | ||
import catalog.models.schema.v1.workload as wl | ||
import catalog.models.schema.v1.workload.container as c | ||
import catalog.models.schema.v1.workload.container.probe as p | ||
import catalog.models.schema.v1.workload.secret as sec | ||
import catalog.models.schema.v1.workload.network as n | ||
import catalog.models.schema.v1.monitoring as m | ||
|
||
import test_update_1 as tu | ||
import helloworld as oci_helloworld | ||
|
||
local = tu.The_first_kcl_program | ||
oci = oci_helloworld.The_first_kcl_program | ||
|
||
# base.k declares reusable configurations for all stacks. | ||
hello: ac.AppConfiguration { | ||
workload: wl.Service { | ||
containers: { | ||
"nginx": c.Container { | ||
image: "nginx:v1" | ||
# Run the following command as defined | ||
command: ["/bin/sh", "-c", "echo hi"] | ||
# Extra arguments append to command defined above | ||
args: ["/bin/sh", "-c", "echo hi"] | ||
env: { | ||
# An environment variable of name "env1" and value "VALUE" will be set | ||
"env1": "VALUE" | ||
# An environment variable of name "env2" and value of the key "key" in the | ||
# secret named "sec-name" will be set. | ||
"env2": "secret://sec-name/key" | ||
} | ||
# Run the command "/bin/sh -c echo hi", as defined above, in the directory "/tmp" | ||
workingDir: "/tmp" | ||
resources: { | ||
"cpu": "2" | ||
"memory": "4Gi" | ||
} | ||
# Configure a HTTP readiness probe | ||
readinessProbe: p.Probe { | ||
probeHandler: p.Http { | ||
url: "http://localhost:80" | ||
} | ||
initialDelaySeconds: 10 | ||
} | ||
} | ||
} | ||
secrets: { | ||
"basic-auth": sec.Secret { | ||
$type: "basic" | ||
data: { | ||
"username": "admin" | ||
"password": "******" | ||
} | ||
} | ||
} | ||
replicas: 2 | ||
ports: [ | ||
n.Port { | ||
type: "aliyun" | ||
port: 80 | ||
targetPort: 8080 | ||
public: True | ||
} | ||
] | ||
} | ||
# Add the monitoring configuration backed by Prometheus | ||
monitoring: m.Prometheus{ | ||
interval: "30s" | ||
timeout: "15s" | ||
path: "/metrics" | ||
port: "web" | ||
scheme: "http" | ||
} | ||
} | ||
|
||
hellocollaset: ac.AppConfiguration { | ||
workload: wl.Service { | ||
type: "CollaSet" | ||
containers: { | ||
"nginx": c.Container { | ||
image: "nginx:v1" | ||
# Run the following command as defined | ||
command: ["/bin/sh", "-c", "echo hi"] | ||
# Extra arguments append to command defined above | ||
args: ["/bin/sh", "-c", "echo hi"] | ||
# Run the command "/bin/sh -c echo hi", as defined above, in the directory "/tmp" | ||
workingDir: "/tmp" | ||
} | ||
} | ||
ports: [ | ||
n.Port { | ||
port: 80 | ||
} | ||
] | ||
} | ||
opsRule: t.OpsRule { | ||
maxUnavailable: "30%" | ||
} | ||
} | ||
|
||
hellojob: ac.AppConfiguration { | ||
workload: wl.Job { | ||
containers: { | ||
"busybox": c.Container { | ||
image: "busybox:1.28" | ||
# Run the following command as defined | ||
command: ["/bin/sh", "-c", "echo hello"] | ||
} | ||
} | ||
# Run every hour. | ||
schedule: "0 * * * *" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/e2e/test_suites/test_data/test_update_with_all/test_update_1/kcl.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
name = "test_update_1" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
Empty file.
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/test_data/test_update_with_all/test_update_1/main.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The_first_kcl_program = 'Hello Local !' |