Skip to content

Commit

Permalink
Merge pull request #234 from Peefy/konfig-0.8.0
Browse files Browse the repository at this point in the history
feat: release konfig 0.8.0
  • Loading branch information
Peefy authored Sep 11, 2024
2 parents 1f84d9a + 826396f commit 5362977
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 72 deletions.
56 changes: 0 additions & 56 deletions konfig/README-zh.md

This file was deleted.

11 changes: 6 additions & 5 deletions konfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig?ref=badge_shield)


[English](README.md) | [Chinese](README-zh.md)

Konfig is the repository of the infra configuration in KCL.

Konfig provides users with an out-of-the-box, highly abstract configuration interface. The original starting point of the model library is to improve the efficiency and experience of YAML users. We hope to simplify the writing of user-side configuration code by abstracting and encapsulating the model with more complex code into a unified model.

For more details, please refer to: [Model Overview](https://kcl-lang.io/docs/user_docs/guides/working-with-konfig/overview)
Expand Down Expand Up @@ -56,9 +53,13 @@ Install [KCL](https://kcl-lang.io/docs/user_docs/getting-started/install)

See [here](https://kcl-lang.io/docs/user_docs/guides/working-with-konfig/guide)

## Resources

- More examples can be found [here](https://github.com/kcl-lang/konfig/blob/main/examples/README.md)
- Konfig schema reference document can be found [here](https://github.com/kcl-lang/konfig/blob/main/docs/konfig.md)

## License

Apache License Version 2.0


[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig?ref=badge_large)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkcl-lang%2Fkonfig?ref=badge_large)
4 changes: 2 additions & 2 deletions konfig/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "konfig"
version = "0.7.0"
version = "0.8.0"
description = "Konfig provides users with an out-of-the-box, highly abstract configuration interface. The original starting point of the model library is to improve the efficiency and experience of YAML users. We hope to simplify the writing of user-side configuration code by abstracting and encapsulating the model with more complex code into a unified model."

[dependencies]
k8s = "1.28"
k8s = "1.31"
8 changes: 2 additions & 6 deletions konfig/kcl.mod.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
[dependencies]
[dependencies.k8s]
name = "k8s"
full_name = "k8s_1.28"
version = "1.28"
sum = "aTxPUVZyr9MdiB3YdiY/8pCh9sC55yURnZdGlJsKG6Q="
reg = "ghcr.io"
repo = "kcl-lang/k8s"
oci_tag = "1.28"
full_name = "k8s_1.31"
version = "1.31"
7 changes: 7 additions & 0 deletions konfig/models/kube/frontend/job.k
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ schema Job:

Attributes
----------
name: str, default is Undefined, optional.
The name of the workload and service.
If not defined, a generated name ("{__META_APP_NAME}-{__META_ENV_TYPE_NAME}") will be used.
The value of metadata.__META_APP_NAME will be extracted from the value of the "name" defined through option("app"),
and the value of metadata.__META_ENV_TYPE_NAME will be extracted from the value of the "name" defined through option("env").
activeDeadlineSeconds: int, default is Undefined, optional.
Specifies the duration in seconds relative to the startTime that the job may be active
before the system tries to terminate it; value must be positive integer
Expand Down Expand Up @@ -80,6 +85,8 @@ schema Job:
}
"""

# job name
name?: str
# subset of batchv1.JobSpec
activeDeadlineSeconds?: int
backoffLimit?: int = 6
Expand Down
4 changes: 2 additions & 2 deletions konfig/models/kube/frontend/server.k
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ schema Server:
name: str, default is Undefined, optional.
The name of the workload and service.
If not defined, a generated name ("{__META_APP_NAME}-{__META_ENV_TYPE_NAME}") will be used.
The value of __META_APP_NAME will be extracted from the value of the "name" defined in project.yaml,
and the value of __META_ENV_TYPE_NAME will be extracted from the value of the "name" defined in stack.yaml.
The value of metadata.__META_APP_NAME will be extracted from the value of the "name" defined through option("app"),
and the value of metadata.__META_ENV_TYPE_NAME will be extracted from the value of the "name" defined through option("env").
workloadType: "Deployment" | "StatefulSet", default is "Deployment", required.
Application workload type, default to 'Deployment'
renderType: "Server" | "KubeVelaApplication", default is "Server", optional.
Expand Down
2 changes: 1 addition & 1 deletion konfig/models/kube/render/render.k
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ __resource_map_original___: {str: []} = {
__resource_map___: {str: []} = {kind = remove_duplicated_iter(res_list, checkIdentical) for kind, res_list in __resource_map_original___}

# kubernetes id: apiVersion:Kind:Namespace:Name
getId = lambda _resource {
getId = lambda _resource -> str {
_resource.apiVersion + ":" + _resource.kind + ":" + (_resource.metadata.namespace + ":" if _resource.metadata.namespace else "") + _resource.metadata.name
}

Expand Down

0 comments on commit 5362977

Please sign in to comment.