Skip to content

Commit

Permalink
Adjust to new kustomize syntax.
Browse files Browse the repository at this point in the history
Use resources rather than base.
Insert path: before filenames referenced in patches.
Reference: kubernetes-sigs/kustomize#4911
Supercedes: #329

Signed-off-by: Kurt Garloff <kurt@garloff.de>
  • Loading branch information
garloff committed Mar 5, 2023
1 parent 37ee2ef commit c5c155d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions terraform/files/bin/kustpatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ if test ! -s $KTMPDIR/base/base.yaml; then
fi
fi
echo -e "resources:\n - base.yaml" >> $KTMPDIR/base/kustomization.yaml
echo -e "bases:\n - ../base\npatches:" >> $KTMPDIR/patch/kustomization.yaml
echo -e "resources:\n - ../base\npatches:" >> $KTMPDIR/patch/kustomization.yaml

for patch in "$@"; do
if test ! -s "$patch"; then echo "ERROR: Patch file $patch not readable" 1>&2; usage 5; fi
cp -p "$patch" $KTMPDIR/patch/
echo " - ${patch##*/}" >> $KTMPDIR/patch/kustomization.yaml
echo " - path: ${patch##*/}" >> $KTMPDIR/patch/kustomization.yaml
done
cd $KTMPDIR
kustomize build patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
resources:
- ../base
patches:
- nginx-monitor.yaml
- path: nginx-monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
resources:
- ../base
patches:
- nginx-nomonitor.yaml
- path: nginx-nomonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
resources:
- ../base
patches:
- nginx-monitor.yaml
- nginx-proxy-cfgmap.yaml
- nginx-proxy-lb.yaml
- path: nginx-monitor.yaml
- path: nginx-proxy-cfgmap.yaml
- path: nginx-proxy-lb.yaml

0 comments on commit c5c155d

Please sign in to comment.