-
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.
feat: add api to get the dependencies from kcl.mod
Signed-off-by: zongz <zongzhe1024@163.com>
- Loading branch information
Showing
7 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "kcl_pkg" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
k8s = "1.27" |
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,34 @@ | ||
import sub | ||
import sub.sub1 as s1 | ||
import k8s.api.core.v1 as k8core | ||
|
||
schema SchemaInMainK: | ||
msg: str | ||
|
||
schema SchemaWithSameName: | ||
msg: str | ||
|
||
schema_in_main_k = SchemaInMainK { | ||
msg='I am the instance of SchemaInMainK' | ||
} | ||
|
||
schema_in_sub_k = sub.SchemaInSubK { | ||
msg='I am the instance of SchemaInSubK' | ||
} | ||
|
||
schema_with_same_name = SchemaWithSameName { | ||
msg='I am the instance of SchemaWithSameName in main.k' | ||
} | ||
|
||
schema_with_same_name_in_sub = s1.SchemaWithSameName { | ||
msg='I am the instance of SchemaWithSameName in sub.k' | ||
} | ||
|
||
schema_in_k8s = k8core.Pod { | ||
metadata.name = "web-app" | ||
spec.containers = [{ | ||
name = "main-container" | ||
image = "nginx" | ||
ports = [{containerPort: 80}] | ||
}] | ||
} |
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 @@ | ||
schema SchemaInSubK: | ||
msg: str |
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 @@ | ||
schema SchemaInSubSub1K: | ||
msg: str |
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 @@ | ||
schema SchemaWithSameName: | ||
msg: str |