Skip to content

Commit 093869a

Browse files
committed
v0.7.0
1 parent d3a9f09 commit 093869a

File tree

7 files changed

+34
-54
lines changed

7 files changed

+34
-54
lines changed

CHANGELOG.md

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

33
- [Changelog](#changelog)
4-
- [v0.6.0](#v060)
4+
- [v0.7.0](#v070)
5+
- [v0.7.0](#v070-1)
56
- [v0.5.2](#v052)
67
- [v0.5.1](#v051)
78
- [v0.5.0](#v050)
@@ -10,7 +11,12 @@
1011

1112
---
1213

13-
## [v0.6.0](https://github.com/chicken231/helmizer/releases/tag/v0.6.0)
14+
## [v0.7.0](https://github.com/chicken231/helmizer/releases/tag/v0.7.0)
15+
16+
- Catch when no `helmizer` config detected, giving a user-friendly message.
17+
- Added `helmizer.ignore` section to helmizer config. Define path(s) to files to not ignore when constructing the final kustomization.
18+
19+
## [v0.7.0](https://github.com/chicken231/helmizer/releases/tag/v0.7.0)
1420

1521
- Reduce arguments to 1 positional argument pointing to helmizer config file.
1622
- Fix issues with arguments referencing paths.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ optional arguments:
3939
4040
--debug enable debug logging (default: False)
4141
--dry-run do not write to a file system (default: False)
42-
helmizer_config path to helmizer config file
4342
--quiet, -q quiet output from subprocesses (default: False)
4443
--version show program's version number and exit
44+
helmizer_config path to helmizer config file
4545
```
4646

4747
## Configuration
@@ -75,6 +75,8 @@ helmizer:
7575
resource-absolute-paths: []
7676
sort-keys: true
7777
version: '0.1.0'
78+
ignore:
79+
- sealed-secrets/templates/helmizer.yaml
7880
kustomize:
7981
namespace: sealed-secrets
8082
resources:
@@ -100,7 +102,7 @@ The `sealed-secrets` **Helm** chart is used for examples for its small scope.
100102
For local installation/use of the raw script, I use a local virtual environment to isolate dependencies:
101103

102104
```bash
103-
git clone https://github.com/chicken231/helmizer.git -b v0.6.0
105+
git clone https://github.com/chicken231/helmizer.git -b v0.7.0
104106
cd helmizer
105107
```
106108

@@ -182,7 +184,7 @@ In this example (*Nix OS), we're redirecting program output to the (e.g. `kustom
182184
docker run --name helmizer \
183185
--rm \
184186
-v "$PWD"/examples:/tmp/helmizer -w /tmp/helmizer \
185-
docker.pkg.github.com/chicken231/helmizer/helmizer:v0.6.0 /usr/src/app/helmizer.py \
187+
docker.pkg.github.com/chicken231/helmizer/helmizer:v0.7.0 /usr/src/app/helmizer.py \
186188
./resources/ > ./examples/resources/kustomization.yaml
187189
```
188190

build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ if [ $# -eq 0 ]; then
77
exit 1
88
fi
99

10-
# pyinstaller
11-
# pyinstaller -y --workpath ./build/pyinstaller/linux/workpath --specpath ./build/pyinstaller/linux/ --distpath ./build/pyinstaller/linux/ src/helmizer.py
12-
# mkdir -p ./build/pyinstaller/linux/releases/
13-
# zip -9 -T -r "./build/pyinstaller/linux/releases/${TAG}.zip" ./build/pyinstaller/linux/helmizer
14-
# unlink ./build/pyinstaller/linux/releases/current || true
15-
# ln -s ./build/pyinstaller/linux/helmizer/helmizer ./build/pyinstaller/linux/releases/current
16-
1710
# docker
1811
DOCKER_CREATE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
1912
printf "\n * Docker container label (timestamp): %s" "$DOCKER_CREATE_DATE"

docs/developers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Developers
22

33
- [Developers](#developers)
4-
- [PyInstaller](#pyinstaller)
5-
- [Linux](#linux)
4+
- [~~PyInstaller~~](#pyinstaller)
5+
- [~~Linux~~](#linux)
66
- [~~Flatpak~~](#flatpak)
77
- [Prep release](#prep-release)
88

9-
## PyInstaller
9+
## ~~PyInstaller~~
1010

1111
- https://pyinstaller.readthedocs.io/en/stable/index.html
1212

13-
### Linux
13+
### ~~Linux~~
1414

1515
1. Install package via `pip`:
1616
```bash

examples/commonAnnotations/helmizer.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ helmizer:
1818
kustomization-file-name: kustomization.yaml
1919
sort-keys: false
2020
version: '0.1.0'
21+
ignore:
22+
- sealed-secrets/templates/helmizer.yaml
2123
kustomize:
2224
namespace: sealed-secrets
2325
resources:

org.chicken231.Helmizer.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/helmizer.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ def get_files(self, arguments, key):
180180
for final_target_path in list_target_paths:
181181
list_final_target_paths.append(path.relpath(final_target_path, str_kustomization_path))
182182

183+
# remove any ignored files
184+
try:
185+
for ignore in self.helmizer_config['helmizer']['ignore'].get(list):
186+
list_final_target_paths.remove(ignore)
187+
except ValueError:
188+
pass
189+
except NotFoundError:
190+
pass
191+
183192
return list_final_target_paths
184193

185194
except NotFoundError:
@@ -229,11 +238,10 @@ def init_arg_parser():
229238
args = parser.add_argument_group()
230239
args.add_argument('--debug', dest='debug', action='store_true', help='enable debug logging', default=False)
231240
args.add_argument('--dry-run', dest='dry_run', action='store_true', help='do not write to a file system', default=False)
232-
args.add_argument('helmizer_config', action='store', type=str,
233-
help='path to helmizer config file')
234241
args.add_argument('--quiet', '-q', dest='quiet', action='store_true', help='quiet output from subprocesses',
235242
default=False)
236-
args.add_argument('--version', action='version', version='v0.6.0')
243+
args.add_argument('--version', action='version', version='v0.7.0')
244+
args.add_argument('helmizer_config', action='store', type=str, help='path to helmizer config file')
237245
arguments = parser.parse_args()
238246

239247
if arguments.quiet:
@@ -266,9 +274,11 @@ def init_helmizer_config(arguments):
266274
logging.debug(f'Trying helmizer config path from argument: {str_helmizer_config_path}')
267275
config.set_file(path.normpath(str_helmizer_config_path))
268276
logging.debug(f'parsed config: {config}')
277+
278+
# no config file found. Give up
269279
except confuse.exceptions.ConfigReadError:
270-
# no config file found. Give up
271-
return dict()
280+
logging.error(f'Unable to locate helmizer config. Path provided: {str_helmizer_config_path}')
281+
exit(1)
272282

273283
try:
274284
validate_helmizer_config_version(config['helmizer']['version'].get(str))

0 commit comments

Comments
 (0)