Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use mapfile as it isn't bash 3 compatible #77362

Merged
merged 1 commit into from May 7, 2019

Conversation

@cblecker
Copy link
Member

commented May 2, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Moves away from using mapfile in hack/lib/golang.sh so that users don't have to use bash 4+. This mainly fixes building on Darwin.

Which issue(s) this PR fixes:
Fixes #77349

Does this PR introduce a user-facing change?:

NONE
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cblecker

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cblecker

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

/cc @BenTheElder @mtaufen @thockin
/priority important-soon
/sig release

Show resolved Hide resolved hack/lib/util.sh Outdated
Show resolved Hide resolved hack/lib/util.sh Outdated

@cblecker cblecker force-pushed the cblecker:fix-bash-3 branch from b8c3b01 to 2469fe4 May 2, 2019

@mtaufen

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

/assign @thockin

@thockin
Copy link
Member

left a comment

BLECH. Does this work in the wonky bash 4.3 also?

@cblecker

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

@thockin I'm not sure, I don't have a bash 4.3 environment set up to test. I have bash 3.2 and 5.0 installed on my system.

@thockin

This comment has been minimized.

Copy link
Member

commented May 3, 2019

@cblecker

This comment has been minimized.

Copy link
Member Author

commented May 3, 2019

Thanks for the tip. Yes, this logic works:

$ docker run -ti  --entrypoint bash debian:jessie
root@1328009e9c49:/# function kube::util::read-array {
>   local i=0
>   unset -v "$1"
>   while IFS= read -r "$1[i++]"; do :; done
>   eval "[[ \${$1[--i]} ]]" || unset "$1[i]"
> }
root@1328009e9c49:/# kube::util::read-array files < <(ls -1 /)
root@1328009e9c49:/# echo ${files[@]}
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
root@1328009e9c49:/# echo ${files[5]}
lib
root@1328009e9c49:/#
@spiffxp

This comment has been minimized.

Copy link
Member

commented May 6, 2019

/lgtm
/hold
for a nit, which @cblecker or @thockin are free to cancel if satisfied this is good enough

@cblecker cblecker force-pushed the cblecker:fix-bash-3 branch from 2469fe4 to eaafa59 May 6, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 6, 2019

@cblecker

This comment has been minimized.

Copy link
Member Author

commented May 6, 2019

/retest

@spiffxp spiffxp closed this May 6, 2019

@spiffxp spiffxp reopened this May 6, 2019

@spiffxp

This comment has been minimized.

Copy link
Member

commented May 6, 2019

/lgtm
Wrong button! Sorry...

@k8s-ci-robot k8s-ci-robot added the lgtm label May 6, 2019

@cblecker

This comment has been minimized.

Copy link
Member Author

commented May 6, 2019

/hold cancel

@BenTheElder

This comment has been minimized.

Copy link
Member

commented May 7, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit b3a73f7 into kubernetes:master May 7, 2019

20 checks passed

cla/linuxfoundation cblecker authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@cblecker cblecker deleted the cblecker:fix-bash-3 branch May 7, 2019

k8s-ci-robot added a commit that referenced this pull request May 19, 2019

Merge pull request #78082 from cblecker/automated-cherry-pick-of-#77362-
#77910-#77985-#78048-#78059-upstream-release-1.14

Automated cherry pick of #77362: Don't use mapfile as it isn't bash 3 compatible #77910: fix unbound array variable #77985: fix unbound variable release.sh #78048: Don't use declare -g in build #78059: Check KUBE_SERVER_PLATFORMS existence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.