Skip to content

Commit

Permalink
Merge pull request #61 from ashcrow/RHBZ1792423
Browse files Browse the repository at this point in the history
rhcos-toolbox: Pass env to sudo when required
  • Loading branch information
ashcrow committed Feb 3, 2020
2 parents b623dc3 + 4801efb commit 5a91d33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rhcos-toolbox
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ image_runlabel() {
}

image_pull() {
if ! sudo podman pull --authfile /var/lib/kubelet/config.json "$TOOLBOX_IMAGE"; then
if ! sudo --preserve-env podman pull --authfile /var/lib/kubelet/config.json "$TOOLBOX_IMAGE"; then
read -r -p "Would you like to manually authenticate to registry: '${REGISTRY}' and try again? [y/N] "

if [[ $REPLY =~ ^([Yy][Ee][Ss]|[Yy])+$ ]]; then
sudo podman login "${REGISTRY}"
sudo podman pull "$TOOLBOX_IMAGE"
sudo --preserve-env podman login "${REGISTRY}"
sudo --preserve-env podman pull "$TOOLBOX_IMAGE"
else
echo "Exiting..."
exit 1
Expand Down

0 comments on commit 5a91d33

Please sign in to comment.