Skip to content

Commit d30b82d

Browse files
committed
v0.11.0
1 parent e790530 commit d30b82d

File tree

6 files changed

+29
-31
lines changed

6 files changed

+29
-31
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ repos:
2929
- id: requirements-txt-fixer
3030
- id: check-ast
3131
repo: 'https://github.com/pre-commit/pre-commit-hooks'
32-
rev: v4.1.0
32+
rev: v4.2.0
3333
- hooks:
3434
- id: black
3535
language_version: python3.9
3636
args:
3737
- --line-length
3838
- "140"
3939
repo: https://github.com/psf/black
40-
rev: 21.12b0
40+
rev: 22.3.0
4141
- repo: https://gitlab.com/pycqa/flake8
4242
rev: 3.9.2
4343
hooks:

.vscode/launch.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,6 @@
213213
"program": "${workspaceFolder}/src/helmizer.py",
214214
"request": "launch",
215215
"type": "python"
216-
},
217-
{
218-
"args": [
219-
"--debug",
220-
"/home/drew/Nextcloud/TECH/git/private/lab-k8s/flux/kustomize/helm/cert-manager/helmizer.yaml"
221-
],
222-
"console": "integratedTerminal",
223-
"cwd": "${workspaceFolder}",
224-
"name": "TEMP",
225-
"program": "${workspaceFolder}/src/helmizer.py",
226-
"request": "launch",
227-
"type": "python"
228216
}
229217
],
230218
"version": "0.2.0"

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"*test.py"
99
],
1010
"python.testing.pytestEnabled": false,
11-
"python.testing.nosetestsEnabled": false,
1211
"python.testing.unittestEnabled": false,
1312
"python.testing.promptToConfigure": false,
14-
"python.pythonPath": "/home/drew/Nextcloud/TECH/git/private/helmizer/venv/bin/python"
13+
"python.defaultInterpreterPath": "./helmizer/venv/bin/python"
1514
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
- [Changelog](#changelog)
4+
- [v0.11.0](#v0110)
45
- [v0.10.0](#v0100)
56
- [v0.9.1](#v091)
67
- [v0.9.0](#v090)
@@ -15,6 +16,18 @@
1516

1617
---
1718

19+
## [v0.11.0](https://github.com/DaemonDude23/helmizer/releases/tag/v0.11.0)
20+
21+
April 11 2022
22+
23+
**Enhancements**
24+
25+
- Added support for `buildMetadata and `patches`.
26+
27+
**Housekeeping**
28+
29+
- Cleaned up vscode configs.
30+
1831
## [v0.10.0](https://github.com/DaemonDude23/helmizer/releases/tag/v0.10.0)
1932

2033
January 21 2022

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818

1919
## About
2020

21+
**TLDR**
22+
23+
Generates a `kustomization.yaml file`, optionally providing the ability to run commands (e.g. `helm template`) on your OS prior to generating a kustomization, and will compose the kustomization fields that deal with file paths (e.g. `resources`) with glob-like features, as well as pass-through all other kustomization configuration properties. No need to explicitly enumerate every file to be kustomized individually.
24+
25+
It takes a config file as input, telling **Helmizer** if you want to run any commands. Then if you give it one or more directories for `resources`, for example, it will recursively lookup all of those files and render them into your kustomization.yaml. Want to skip including one file like `templates/secret.yaml`? Just add the relative path to `helmizer.ignore` to `helmizer.yaml`.
26+
27+
---
28+
2129
[Thou shall not _glob_](https://github.com/kubernetes-sigs/kustomize/issues/3205), said the **kustomize** developers (thus far).
2230

2331
**Helmizer** takes various inputs from a YAML config file (`helmizer.yaml` by default) and constructs a [kustomization file](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/) from those inputs. It can run a sequence of commands before rendering the kustomization file.
2432

2533
Instead of manually entering the paths to [`resources`](https://kubectl.docs.kubernetes.io/references/kustomize/resource/) in a kustomization file, this tool will walk any number of directories containing resources and populate the kustomization with these resources. Or only pull in individual files, it's your choice.
2634

27-
I began transitioning my `helm` charts to local templates via [`helm template`](https://helm.sh/docs/helm/helm_template/), which were then applied to the cluster separately via [Kustomize](https://kustomize.io/). I didn't enjoy having to manually manage the relative paths to files in the **kustomization**. I wanted a repeatable process to generate **Kubernetes** manifests from a helm chart, _and_ tack on any patches or related resources later with a single command. Thus, **helmizer**. **But [Helm](https://helm.sh/) is in no way required to make this tool useful** - have it walk your raw manifests as well.
28-
29-
**TLDR**
30-
31-
Provides the ability to run commands (e.g. `helm template`) on your OS prior to generating a kustomization, and will compose the kustomization fields that deal with file paths (e.g. `resources`) with glob-like features, as well as pass-through all other kustomization configurations. No need to explicitly enumerate every file individually.
35+
I began transitioning my `helm` charts to local manifests via [`helm template`](https://helm.sh/docs/helm/helm_template/), which were then applied to the cluster separately via [Kustomize](https://kustomize.io/). I didn't enjoy having to manually manage the relative paths to files in the **kustomization**. I wanted a repeatable process to generate **Kubernetes** manifests from a helm chart, _and_ tack on any patches or related resources later with a single command. Thus, **helmizer**. **But [Helm](https://helm.sh/) is in no way required to make this tool useful** - have it walk your raw manifests as well. This is just a wrapper that allows combining steps, and glob-like behavior, to managing `kustomization.yaml` files.
3236

3337
## Usage
3438

@@ -157,7 +161,7 @@ kustomize: # this is essentially an overlay for your eventual kustomization.yam
157161
For local installation/use of the raw script, I use a local virtual environment to isolate dependencies:
158162
159163
```bash
160-
git clone https://github.com/DaemonDude23/helmizer.git -b v0.10.0
164+
git clone https://github.com/DaemonDude23/helmizer.git -b v0.11.0
161165
cd helmizer
162166
```
163167

@@ -274,7 +278,7 @@ In this example (*Nix OS), we're redirecting program output to the (e.g. `kustom
274278
docker run --name helmizer \
275279
--rm \
276280
-v "$PWD"/examples:/tmp/helmizer -w /tmp/helmizer \
277-
docker.pkg.github.com/DaemonDude23/helmizer/helmizer:v0.10.0 /usr/src/app/helmizer.py \
281+
docker.pkg.github.com/DaemonDude23/helmizer/helmizer:v0.11.0 /usr/src/app/helmizer.py \
278282
./resources/ > ./examples/resources/kustomization.yaml
279283
```
280284

src/helmizer.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, helmizer_config, arguments):
4141
pass
4242

4343
# get lists
44-
for key in ["configMapGenerator", "images", "patchesJson6902", "replicas", "replacements", "vars"]:
44+
for key in ["buildMetadata", "configMapGenerator", "images", "patches", "patchesJson6902", "replicas", "replacements", "vars"]:
4545
try:
4646
list_key = self.get_list(key)
4747
if list_key:
@@ -216,10 +216,8 @@ def get_dict(self, key):
216216
logging.debug(f"{key}: {dict_raw_yaml}")
217217
except NotFoundError:
218218
logging.debug(f"key not found: {key}")
219-
pass
220219
except KeyError:
221220
logging.debug(f"key not found: {key}")
222-
pass
223221
except TypeError:
224222
pass
225223
return dict_raw_yaml
@@ -232,10 +230,8 @@ def get_str(self, key):
232230
logging.debug(f"{key}: {str_raw_yaml}")
233231
except NotFoundError:
234232
logging.debug(f"key not found: {key}")
235-
pass
236233
except KeyError:
237234
logging.debug(f"key not found: {key}")
238-
pass
239235
except TypeError:
240236
pass
241237
return str_raw_yaml
@@ -248,10 +244,8 @@ def get_list(self, key):
248244
logging.debug(f"{key}: {list_raw_yaml}")
249245
except NotFoundError:
250246
logging.debug(f"key not found: {key}")
251-
pass
252247
except KeyError:
253248
logging.debug(f"key not found: {key}")
254-
pass
255249
except TypeError:
256250
pass
257251
return list_raw_yaml
@@ -335,7 +329,7 @@ def init_arg_parser():
335329
help="quiet output from subprocesses",
336330
default=False,
337331
)
338-
args.add_argument("--version", "-v", action="version", version="v0.10.0")
332+
args.add_argument("--version", "-v", action="version", version="v0.11.0")
339333
args.add_argument(
340334
"helmizer_config",
341335
action="store",

0 commit comments

Comments
 (0)