File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
backend/src/routes/api/appwrappers Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change 1- kubectl get appwrapper --all-namespaces --no-headers \
2- | awk ' {print $1, $2}' \
3- | while read namespace name;
4- do
1+
2+
3+ if kubectl get appwrapper --all-namespaces & > /dev/null; then
4+ # Admin User
5+ kubectl get appwrapper --all-namespaces --no-headers \
6+ | awk ' {print $1, $2}' \
7+ | while read namespace name;
8+ do
59 kubectl get appwrapper $name -n $namespace -o json
6- done
10+ done
11+ # Non-Admin User
12+ else
13+ NAMESPACES=($( kubectl get projects --no-headers | awk ' {print $1}' ) )
14+ for namespace in " ${NAMESPACES[@]} " ; do
15+ output=$( kubectl get appwrapper -n $namespace --no-headers | awk ' {print $1}' )
16+ if [[ -z " $output " ]]; then
17+ continue
18+ else
19+ for appwrapper_name in $output ; do
20+ kubectl get appwrapper " $appwrapper_name " -n " $namespace " -o json
21+ done
22+ fi
23+ done 2> /dev/null
24+ fi
You can’t perform that action at this time.
0 commit comments