File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
K3D_CLUSTER_NAME=${K3D_CLUSTER_NAME:- " local" }
4
4
5
- if [ " $( k3d cluster list | grep -o -E " ^${K3D_CLUSTER_NAME} " ) " ] ; then
5
+ if k3d cluster list | grep -q - o -E " ^${K3D_CLUSTER_NAME} " ; then
6
6
set +e
7
- namespaces=$( tk env list --json | jq -r ' .[].spec .namespace' | sort | uniq )
7
+ namespaces=" $( find rendered -type f -path ' */manifests/*.yaml ' -print0 | xargs -0 -P1 yq eval-all --output-format csv ' [.metadata .namespace] | map(select(. != null)) ' | tr ' , ' ' \n ' | sort -u ) "
8
8
while IFS= read -r namespace; do
9
9
echo " Creating namespace $namespace ....."
10
- out=$( kubectl --context k3d-${K3D_CLUSTER_NAME} create namespace $namespace 2>&1 )
10
+ out=$( kubectl --context " k3d-${K3D_CLUSTER_NAME} " create namespace " $namespace " 2>&1 )
11
11
if [[ " $out " == * " AlreadyExists" * ]]; then
12
12
echo " Namespace $namespace already exists, skipping"
13
13
else
You can’t perform that action at this time.
0 commit comments