Skip to content

Commit

Permalink
Fix awk expression in normalize_image
Browse files Browse the repository at this point in the history
  • Loading branch information
futuretea authored and guangbochen committed Dec 20, 2021
1 parent e14fb0f commit 3af28b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/build-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ curl ${longhorn_image_url}>>${image_list_file}

# format image list
awk -F ':' '{if($2==""){print $1":latest"}else{print $0}}' "${image_list_file}" | \
awk -F '/' '{if(NF>=3){print $0} else if(NF==2){print "docker.io/"$0}else if(NF=1){print "docker.io/library/"$0}}' >"${image_list_file}.tmp"
awk -F '/' '{if(NF>=3){print $0} else if(NF==2){print "docker.io/"$0}else if(NF==1){print "docker.io/library/"$0}}' >"${image_list_file}.tmp"

# clean image list
sort -u "${image_list_file}.tmp" | \
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/image
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# test.com/rancher/rancher -> test.com/rancher/rancher
normalize_image()
{
echo $1 | awk -F '/' '{if(NF>=3){print $0} else if(NF==2){print "docker.io/"$0}else if(NF=1){print "docker.io/library/"$0}}'
echo $1 | awk -F '/' '{if(NF>=3){print $0} else if(NF==2){print "docker.io/"$0}else if(NF==1){print "docker.io/library/"$0}}'
}

save_image_list()
Expand Down

0 comments on commit 3af28b4

Please sign in to comment.