generated from MacroPower/go_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a KCL module to wrap the helm plugin
- Loading branch information
1 parent
b851d1b
commit e4a420b
Showing
4 changed files
with
102 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[package] | ||
name = "helm" | ||
edition = "v0.11.0" | ||
version = "0.0.1" |
Empty file.
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,58 @@ | ||
""" | ||
This module provides an interface for the kclx Helm plugin. | ||
""" | ||
import kcl_plugin.helm as helm_plugin | ||
|
||
schema Chart: | ||
"""Helm chart resource. | ||
|
||
Attributes | ||
---------- | ||
chart: str | ||
The name of the chart to install. | ||
repoURL: str | ||
The URL of the chart repository. | ||
targetRevision: str | ||
Version of the chart to install. | ||
namespace: str, optional. | ||
Namespace to install the chart into. | ||
releaseName: str, optional. | ||
Name of the release. | ||
skipCRDs: bool, default is False, optional. | ||
Set to `True` to skip installing CRDs. | ||
values: any, default is {}, optional. | ||
Chart values. | ||
|
||
Examples | ||
-------- | ||
helm.template(helm.Chart { | ||
chart = "my-chart" | ||
targetRevision = "1.0.0" | ||
repoURL = "https://jacobcolvin.com/helm-charts" | ||
values = { | ||
foo = "bar" | ||
bar = "foo" | ||
} | ||
}) | ||
""" | ||
chart: str | ||
targetRevision: str | ||
repoURL: str | ||
releaseName?: str | ||
namespace?: str | ||
project?: str | ||
skipCRDs?: bool = False | ||
values?: any = {} | ||
|
||
template = lambda c: Chart -> {str:} { | ||
helm_plugin.template( | ||
chart=c.chart, | ||
target_revision=c.targetRevision, | ||
repo_url=c.repoURL, | ||
release_name=c.releaseName, | ||
namespace=c.namespace, | ||
project=c.project, | ||
skip_crds=c.skipCRDs, | ||
values=c.values, | ||
) | ||
} |