Skip to content

Commit

Permalink
fix: Support devel version of Kustomize in install script (#428)
Browse files Browse the repository at this point in the history
Instead of comparing the version of the installed kustomize CLI,
use the kustomize man pages to determine the supported 
format of the --load-restrictor parameter.

Closes #427 

Signed-off-by: Jan Wytze Zuidema <[email protected]>
Signed-off-by: Christian Kadner <[email protected]>
Co-authored-by: Christian Kadner <[email protected]>
  • Loading branch information
janwytze and ckadner authored Sep 19, 2023
1 parent b1116f6 commit f47cd7b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
8 changes: 1 addition & 7 deletions scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,7 @@ popd

# Older versions of kustomize have different load restrictor flag formats.
# Can be removed once Kubeflow installation stops requiring v3.2.
kustomize_version=$(kustomize version --short | grep -o -E "[0-9]\.[0-9]\.[0-9]")
kustomize_load_restrictor_arg="--load-restrictor LoadRestrictionsNone"
if [[ -n "$kustomize_version" && "$kustomize_version" < "3.4.0" ]]; then
kustomize_load_restrictor_arg="--load_restrictor none"
elif [[ -n "$kustomize_version" && "$kustomize_version" < "4.0.1" ]]; then
kustomize_load_restrictor_arg="--load_restrictor LoadRestrictionsNone"
fi
kustomize_load_restrictor_arg=$( kustomize build --help | grep -o -E "\-\-load.restrictor[^,]+" | sed -E "s/(--load.restrictor).+'(.*none)'/\1 \2/I" )

if [[ ! -z $user_ns_array ]]; then
kustomize build runtimes ${kustomize_load_restrictor_arg} > runtimes.yaml
Expand Down
8 changes: 1 addition & 7 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,7 @@ wait_for_pods_ready "-l control-plane=modelmesh-controller"

# Older versions of kustomize have different load restrictor flag formats.
# Can be removed once Kubeflow installation stops requiring v3.2.
kustomize_version=$(kustomize version --short | grep -o -E "[0-9]\.[0-9]\.[0-9]")
kustomize_load_restrictor_arg="--load-restrictor LoadRestrictionsNone"
if [[ -n "$kustomize_version" && "$kustomize_version" < "3.4.0" ]]; then
kustomize_load_restrictor_arg="--load_restrictor none"
elif [[ -n "$kustomize_version" && "$kustomize_version" < "4.0.1" ]]; then
kustomize_load_restrictor_arg="--load_restrictor LoadRestrictionsNone"
fi
kustomize_load_restrictor_arg=$( kustomize build --help | grep -o -E "\-\-load.restrictor[^,]+" | sed -E "s/(--load.restrictor).+'(.*none)'/\1 \2/I" )

info "Installing ModelMesh Serving built-in runtimes"
if [[ $namespace_scope_mode == "true" ]]; then
Expand Down
8 changes: 1 addition & 7 deletions scripts/setup_user_namespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ if [[ ! -z $user_ns_array ]]; then

# Older versions of kustomize have different load restrictor flag formats.
# Can be removed once Kubeflow installation stops requiring v3.2.
kustomize_version=$(kustomize version --short | grep -o -E "[0-9]\.[0-9]\.[0-9]")
kustomize_load_restrictor_arg="--load-restrictor LoadRestrictionsNone"
if [[ -n "$kustomize_version" && "$kustomize_version" < "3.4.0" ]]; then
kustomize_load_restrictor_arg="--load_restrictor none"
elif [[ -n "$kustomize_version" && "$kustomize_version" < "4.0.1" ]]; then
kustomize_load_restrictor_arg="--load_restrictor LoadRestrictionsNone"
fi
kustomize_load_restrictor_arg=$( kustomize build --help | grep -o -E "\-\-load.restrictor[^,]+" | sed -E "s/(--load.restrictor).+'(.*none)'/\1 \2/I" )

cp config/dependencies/minio-storage-secret.yaml .
kustomize build config/runtimes ${kustomize_load_restrictor_arg} > runtimes.yaml
Expand Down

0 comments on commit f47cd7b

Please sign in to comment.