Skip to content

Detect OS X sed and fail client generation script #1441

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

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

roycaihw
Copy link
Member

@roycaihw roycaihw commented Apr 29, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

In the client generation script, fail early if OS X sed is being used and suggest using GNU sed instead. Both the python repo script and the gen repo script use sed in format that OS X sed may not support: https://stackoverflow.com/a/4247319.

Address issues like:

--- Patching generated code...
sed: 1: "/Users/scott/Projects/k ...": bad flag in substitute command: 'l'

Does this PR introduce a user-facing change?

NONE

/cc @scottilee @yliaog

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Apr 29, 2021
@k8s-ci-robot k8s-ci-robot requested a review from yliaog April 29, 2021 18:27
@k8s-ci-robot
Copy link
Contributor

@roycaihw: GitHub didn't allow me to request PR reviews from the following users: scottilee.

Note that only kubernetes-client members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

In the client generation script, fail early if OS X sed is being used and suggest using GNU sed instead. Both the python repo script and the gen repo script use sed in format that OS X sed may not support: https://stackoverflow.com/a/4247319.

Does this PR introduce a user-facing change?

NONE

/cc @scottilee @yliaog

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 29, 2021
@roycaihw
Copy link
Member Author

For more context, here are my local test results:

OS X sed doesn't work with -i and -i''

$ sw_vers
ProductName:	macOS
ProductVersion:	11.2.3
BuildVersion:	20D91
$ /usr/bin/sed -i 's/a/b/g' test
sed: 1: "test": undefined label 'est'
$ /usr/bin/sed -i'' 's/a/b/g' test
sed: 1: "test": undefined label 'est'

GNU sed doesn't work with -i ''

$ sed --version
sed (GNU sed) 4.7
$ sed -i '' 's/a/b/g' test
sed: can't read s/a/b/g: No such file or directory

@yliaog
Copy link
Contributor

yliaog commented Apr 29, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2021
@k8s-ci-robot k8s-ci-robot merged commit 57d74ae into kubernetes-client:master Apr 29, 2021
@roycaihw roycaihw deleted the detect-os-x-sed branch April 29, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants