-
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.
kpt wants a function configuration at once.
- Loading branch information
1 parent
9beefad
commit 788be67
Showing
3 changed files
with
49 additions
and
18 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
tests/multi-replacement/functions/01_multi-transformation.yaml
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,17 @@ | ||
apiVersion: builtin | ||
kind: LocalConfiguration | ||
metadata: | ||
name: configuration-map | ||
annotations: | ||
config.kaweezle.com/inject-local: "true" | ||
config.kubernetes.io/function: | | ||
exec: | ||
path: ../../krmfnbuiltin | ||
data: | ||
sish: | ||
server: target.link | ||
hostname: myhost.target.link | ||
host_key: AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAID+4/eqtPTLC18TE8ZP7NeF4ZP68/wnY2d7mhH/KVs79AAAABHNzaDo= | ||
traefik: | ||
dashboard_enabled: true | ||
expose: true |
18 changes: 0 additions & 18 deletions
18
...ement/functions/multi-transformation.yaml → ...nt/functions/02_multi-transformation.yaml
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,32 @@ | ||
#!/bin/bash | ||
|
||
# DEPENDENCEIS | ||
# kustomize | ||
# yq | ||
|
||
#set -uexo pipefail | ||
set -e pipefail | ||
|
||
temp_file=$(mktemp) | ||
temp_file_2=$(mktemp) | ||
|
||
trap "find . -type d -name 'applications' -exec rm -rf {} +; rm -f $temp_file $temp_file_2" EXIT | ||
|
||
for d in $(ls -d */); do | ||
echo "Running Test in $d..." | ||
cd $d | ||
rm -rf applications | ||
echo " > Performing kustomizations..." | ||
kpt fn source original >$temp_file | ||
for f in functions/*; do | ||
cat $temp_file | kpt fn eval - --exec ../../krmfnbuiltin --fn-config $f >$temp_file_2 | ||
mv $temp_file_2 $temp_file | ||
done | ||
cat $temp_file | kpt fn sink applications | ||
for f in $(ls -1 expected); do | ||
echo " > Checking $f..." | ||
diff <(yq eval -P expected/$f) <(yq eval -P applications/$f) | ||
done | ||
cd .. | ||
done | ||
echo "Done ok 🎉" |