Skip to content

Commit

Permalink
Merge pull request #121 from Peefy/enhance-web-service-with-default-v…
Browse files Browse the repository at this point in the history
…alue

chore: enhance web-service-module with default config
  • Loading branch information
Peefy authored Mar 9, 2024
2 parents a72acec + c35716e commit 51f3f4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web-service/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "web-service"
edition = "*"
version = "0.2.0"
version = "0.3.0"
description = "`web-service` is a kcl abstraction package"

13 changes: 11 additions & 2 deletions web-service/main.k
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schema App:
replicas: int = 1
labels?: {str:str} = {app = name}
service?: Service
containers?: {str: Container}
containers: {str: Container}

schema Service:
"""The service model."""
Expand Down Expand Up @@ -92,5 +92,14 @@ kubernetesRender = lambda a: App {
[deployment, if a.service: service]
}

params: App = option("params")
params: App = option("params") or App {
name: "app"
containers.main = {
args = ["kcl", "run"]
image = "kcllang/kcl"
ports = [ContainerPort {
containerPort = 80
}]
}
}
items = kubernetesRender(params)

0 comments on commit 51f3f4d

Please sign in to comment.