Skip to content

Commit

Permalink
revert version upgrade and just rely on docs
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Marcelo-Tanner <[email protected]>
  • Loading branch information
kzap committed Nov 30, 2023
1 parent 6096cd8 commit 3499dfe
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions test/kustomize/test.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,10 @@
#!/bin/bash

PROJECT_ROOT=$(cd $(dirname ${BASH_SOURCE})/../..; pwd)
DIST_PATH="${PROJECT_ROOT}/dist"

kustomize_cmd="kustomize"
kustomize_version=v5.2.1
kustomize_major_version=v5

# check if local kustomize is installed
if test -x "${DIST_PATH}/kustomize"; then
kustomize_cmd="${DIST_PATH}/kustomize"
# we are unable to check local version of kustomize as it returns (devel) if installs via go install
else
# check if kustomize in path exists and is the expected version
install_kustomize=false
if ! command -v kustomize &> /dev/null; then
echo "kustomize not found in path."
install_kustomize=true
elif ! kustomize version | grep -q "${kustomize_version}"; then
echo "kustomize version is not expected."
install_kustomize=true
fi

# install local kustomize if needed
if ${install_kustomize}; then
echo "Installing local version ${kustomize_version} to ${DIST_PATH}/kustomize";
GOBIN="${DIST_PATH}" GO111MODULE=on go install "sigs.k8s.io/kustomize/kustomize/${kustomize_major_version}@${kustomize_version}"
kustomize_cmd="${DIST_PATH}/kustomize"
fi
fi
echo "Using kustomize: ${kustomize_cmd}"

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

for i in `ls ${DIR}/*/kustomization.yaml`; do
dir_name=$(dirname $i)
diff_out=$(diff ${dir_name}/expected.yaml <("${kustomize_cmd}" build ${dir_name} --load-restrictor=LoadRestrictionsNone))
diff_out=$(diff ${dir_name}/expected.yaml <(kustomize build ${dir_name} --load-restrictor=LoadRestrictionsNone))
if [[ $? -ne 0 ]]; then
echo "${i} had unexpected diff:"
echo "${diff_out}"
Expand Down

0 comments on commit 3499dfe

Please sign in to comment.