Repository navigation
Conversation
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JJJJJones The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
thanks for being thoughtful @JJJJJones how about we do this: Instead of writing code to support two implementations, we can write a |
|
@ahmetb I realize now the PR is misleadingly named because it does more or less what you said. Calls to grep/stat/readlink are prevented by |
|
If I'm not mistaken there is an option to Maybe this is what we want to recommend? For example function ensureGNUUtils () {
if [[ $(uname) == "Darwin" ]]; then
if ! hash sed 2>/dev/null; then
echo "Please install the GNU coreutils with `brew install coreutils --with-secret-option`"
exit 1
fi
fi
} |
I don't see such an option. |
|
This is the key: e.g. https://github.com/ahmetb/dotfiles/blob/78e2c944056223fb55dfd1e5c272b4cb112acdae/.zshrc#L69 |
|
I think that'd be a mistake. Installing coreutils from homebrew and referencing "ggrep" or "greadlink" is idempotent. Modifying the PATH would cause unknown side-effects for developers and maintainers who rely on the MacOS variant of commands (such as me) and requires an extra step of setup for people to work on Krew (which could open up its own problems because of MacOS Catalina's switch from bash to zsh as the default shell). |
|
I've been practically developing on macOS for years in Docker and Kubernetes ecosystem and never hit an issue with this PATH configuration. It's a reasonable expectation from a developer in Kubernetes ecosystem to have an environment with GNU coreutils. Anecdata aside, people will forget this and add scripts that directly invoke |
|
Also so far we're only hearing this problem from you despite many people contributing to Krew. I'm trying to paint the picture that this hasn't been a problem and the solution you provide isn't future-proof. |
|
Kubernetes repo contains 344 times /close |
|
@corneliusweig: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
#364
MacOS grep/readlink/stat are insufficient for certain scripts so this wraps calls to those with a function that ensures the existence of and calls the GNU variant for Mac clients.