-
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.
Merge pull request #244 from zong-zhe/add-git-commit
feat: 'kpm add' supports adding the dependency tagged by git commit
- Loading branch information
Showing
56 changed files
with
906 additions
and
45 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
27 changes: 27 additions & 0 deletions
27
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_commit/expected
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,27 @@ | ||
workload: | ||
containers: | ||
nginx: | ||
image: nginx:v1 | ||
command: | ||
- /bin/sh | ||
- -c | ||
- echo hi | ||
args: | ||
- /bin/sh | ||
- -c | ||
- echo hi | ||
env: | ||
env1: VALUE | ||
env2: secret://sec-name/key | ||
workingDir: /tmp | ||
readinessProbe: | ||
probeHandler: | ||
url: http://localhost:80 | ||
initialDelaySeconds: 10 | ||
replicas: 2 | ||
monitoring: | ||
interval: 30s | ||
timeout: 15s | ||
path: /metrics | ||
port: web | ||
scheme: http |
7 changes: 7 additions & 0 deletions
7
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_commit/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,7 @@ | ||
[package] | ||
name = "dep_git_commit" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" } |
45 changes: 45 additions & 0 deletions
45
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_commit/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,45 @@ | ||
import catalog.models.schema.v1 as ac | ||
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.monitoring as m | ||
|
||
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" | ||
# Configure a HTTP readiness probe | ||
readinessProbe: p.Probe { | ||
probeHandler: p.Http { | ||
url: "http://localhost:80" | ||
} | ||
initialDelaySeconds: 10 | ||
} | ||
} | ||
} | ||
# Set the replicas | ||
replicas: 2 | ||
} | ||
# Add the monitoring configuration backed by Prometheus | ||
monitoring: m.Prometheus{ | ||
interval: "30s" | ||
timeout: "15s" | ||
path: "/metrics" | ||
port: "web" | ||
scheme: "http" | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_tag/expected
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,28 @@ | ||
workload: | ||
containers: | ||
nginx: | ||
image: nginx:v1 | ||
command: | ||
- /bin/sh | ||
- -c | ||
- echo hi | ||
args: | ||
- /bin/sh | ||
- -c | ||
- echo hi | ||
env: | ||
env1: VALUE | ||
env2: secret://sec-name/key | ||
workingDir: /tmp | ||
readinessProbe: | ||
probeHandler: | ||
url: http://localhost:80 | ||
initialDelaySeconds: 10 | ||
replicas: 2 | ||
type: Deployment | ||
monitoring: | ||
interval: 30s | ||
timeout: 15s | ||
path: /metrics | ||
port: web | ||
scheme: http |
7 changes: 7 additions & 0 deletions
7
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_tag/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,7 @@ | ||
[package] | ||
name = "dep_git_tag" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.1" } |
45 changes: 45 additions & 0 deletions
45
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_git_tag/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,45 @@ | ||
import catalog.models.schema.v1 as ac | ||
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.monitoring as m | ||
|
||
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" | ||
# Configure a HTTP readiness probe | ||
readinessProbe: p.Probe { | ||
probeHandler: p.Http { | ||
url: "http://localhost:80" | ||
} | ||
initialDelaySeconds: 10 | ||
} | ||
} | ||
} | ||
# Set the replicas | ||
replicas: 2 | ||
} | ||
# Add the monitoring configuration backed by Prometheus | ||
monitoring: m.Prometheus{ | ||
interval: "30s" | ||
timeout: "15s" | ||
path: "/metrics" | ||
port: "web" | ||
scheme: "http" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
pkg/api/test_data/test_run_pkg_in_path/test_run_no_sum_check/dep_oci/expected
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 @@ | ||
a: Hello World! |
File renamed without changes.
File renamed without changes.
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
6 changes: 6 additions & 0 deletions
6
pkg/client/test_data/add_with_git_commit/test_pkg/kcl.mod.bak
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,6 @@ | ||
[package] | ||
name = "with_sum_check" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] |
7 changes: 7 additions & 0 deletions
7
pkg/client/test_data/add_with_git_commit/test_pkg/kcl.mod.expect
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,7 @@ | ||
[package] | ||
name = "with_sum_check" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" } |
Empty file.
8 changes: 8 additions & 0 deletions
8
pkg/client/test_data/add_with_git_commit/test_pkg/kcl.mod.lock.expect
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,8 @@ | ||
[dependencies] | ||
[dependencies.catalog] | ||
name = "catalog" | ||
full_name = "catalog_a29e3db" | ||
version = "a29e3db" | ||
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks=" | ||
url = "https://github.com/KusionStack/catalog.git" | ||
commit = "a29e3db" |
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 World!' |
Oops, something went wrong.