Skip to content

Commit ed50463

Browse files
committed
allow for selecting the cluster to retrieve
1 parent 3ae6c93 commit ed50463

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/dev/infra-sync.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ clusters_dir="${infra_dir}/clusters"
99
infra_kubeconfig="${INFRA_KUBECONFIG:-${infra_dir}/kubeconfig}"
1010
extra_kubeconfigs="${EXTRA_KUBECONFIGS:-}"
1111
original_kubeconfig="${KUBECONFIG:-}"
12+
opts=($@)
1213

1314
clean_infra_cluster_cache() {
1415
echo "Deleting old cluster artifacts..."
@@ -52,7 +53,7 @@ fetch_infra_clusters() {
5253

5354
# Fetching artifacts for infra clusters.
5455
cluster_names=""
55-
if ! cluster_names=$(infractl list --json | jq -r '(.Clusters // [])[] | select(.Status==2).ID'); then
56+
if ! cluster_names=$(infractl list "${opts[@]}" --json | jq -r '(.Clusters // [])[] | select(.Status==2).ID'); then
5657
echo >&2 "Failed to retrieve clusters names from infra."
5758
exit 1
5859
fi
@@ -105,4 +106,4 @@ if [[ "${original_kubeconfig}" != "${infra_kubeconfig}" ]]; then
105106
echo
106107
echo "For accessing the infra clusters you can use"
107108
echo "export KUBECONFIG=\"${infra_kubeconfig}\""
108-
fi
109+
fi

0 commit comments

Comments
 (0)