Skip to content

Commit

Permalink
fix(velero): replace awk filtering with native kubectl parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alegrey91 committed Jul 5, 2021
1 parent 2d8dd72 commit 947e726
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions hack/velero-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ check_prerequisite () {
# Outputs:
# list of the tenants.
get_tenant_list () {
tenants=$(kubectl "$KUBEOPTIONS" get tnt | \
awk '{if(NR>1)print}' | \
awk '{print $1}' | \
tr '\n' ' ')
tenants=$(kubectl "$KUBEOPTIONS" get tnt \
--no-headers -o custom-columns=":.metadata.name")
echo $tenants
}

Expand All @@ -75,10 +73,8 @@ get_tenant_list () {
# get_namespace_list "oil"
get_namespace_list () {
tnt="$1"
namespaces=$(kubectl "$KUBEOPTIONS" get ns -l capsule.clastix.io/tenant="$tnt" | \
awk '{if(NR>1)print}' | \
awk '{print $1}' | \
tr '\n' ' ')
namespaces=$(kubectl "$KUBEOPTIONS" get ns -l capsule.clastix.io/tenant="$tnt" \
--no-headers -o custom-columns=":metadata.name")
echo $namespaces
}

Expand Down

0 comments on commit 947e726

Please sign in to comment.