Skip to content

Commit

Permalink
Support development version of Kustomize in install, delete and
Browse files Browse the repository at this point in the history
setup_user_namespaces scripts

Signed-off-by: Jan Wytze Zuidema <[email protected]>
  • Loading branch information
janwytze authored and ckadner committed Sep 19, 2023
1 parent b1116f6 commit 90238d4
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 90238d4

Please sign in to comment.