Skip to content

Commit

Permalink
Updata artifacthub-pkg.yaml for
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 25, 2023
1 parent 99cd6fb commit 1cfe236
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
30 changes: 30 additions & 0 deletions set-annotations/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Introduction

`set-annotations` is a kcl mutation package, which can be used to add `metadata.annotations` attributes for the Kubernetes resources.

The KCL code is as follows:

```python
params = option("params") or {}
# Use `k = v` to override existing annotations
annotations: {str:str} = {k = v for k, v in params.annotations or {}}
items = [item | {
metadata.annotations: annotations
} for item in option("items")]
```

## How to Use

Add the source into your `KCLRun` resource and use the [kubectl kcl plugin](https://kcl-lang.io/docs/user_docs/guides/working-with-k8s/mutate-manifests/kubectl-kcl-plugin) or the [kcl operator](https://kcl-lang.io/docs/user_docs/guides/working-with-k8s/mutate-manifests/kcl-operator) to integrate this model.

```yaml
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLRun
metadata:
name: set-annotations
spec:
params:
annotations:
config.kubernetes.io/local-config: "true"
source: oci://ghcr.io/kcl-lang/set-annotations
```
26 changes: 26 additions & 0 deletions set-annotations/0.1.0/artifacthub-pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 0.1.0
name: set-annotations
displayName: set-annotations
createdAt: "2023-10-25T06:46:13Z"
description: '`set-annotations` is a kcl mutation package, which can be used to add
`metadata.annotations` attributes for the Kubernetes resources.'
links:
- name: KCL homepage
url: https://kcl-lang.io/
- name: KCL repo
url: https://github.com/kcl-lang/kcl
install: |
#### Add `set-annotations` with tag `0.1.0` as dependency
```
kpm add set-annotations:0.1.0
```
#### Pull `set-annotations` with tag `0.1.0` to local
```
kpm pull set-annotations:0.1.0
```
maintainers:
- name: kcl-lang.io
email: [email protected]
provider:
name: kcl-lang.io

0 comments on commit 1cfe236

Please sign in to comment.