diff --git a/scripts/dev/infra-sync.sh b/scripts/dev/infra-sync.sh index 0fa38f6..e8d0b6e 100755 --- a/scripts/dev/infra-sync.sh +++ b/scripts/dev/infra-sync.sh @@ -9,6 +9,7 @@ clusters_dir="${infra_dir}/clusters" infra_kubeconfig="${INFRA_KUBECONFIG:-${infra_dir}/kubeconfig}" extra_kubeconfigs="${EXTRA_KUBECONFIGS:-}" original_kubeconfig="${KUBECONFIG:-}" +opts=($@) clean_infra_cluster_cache() { echo "Deleting old cluster artifacts..." @@ -52,7 +53,7 @@ fetch_infra_clusters() { # Fetching artifacts for infra clusters. cluster_names="" - if ! cluster_names=$(infractl list --json | jq -r '(.Clusters // [])[] | select(.Status==2).ID'); then + if ! cluster_names=$(infractl list "${opts[@]}" --json | jq -r '(.Clusters // [])[] | select(.Status==2).ID'); then echo >&2 "Failed to retrieve clusters names from infra." exit 1 fi @@ -105,4 +106,4 @@ if [[ "${original_kubeconfig}" != "${infra_kubeconfig}" ]]; then echo echo "For accessing the infra clusters you can use" echo "export KUBECONFIG=\"${infra_kubeconfig}\"" -fi \ No newline at end of file +fi