Skip to content

Make in-place sed operation portable#2303

Merged
istio-merge-robot merged 2 commits intoistio:masterfrom
sdake:fix_update_versions
Dec 21, 2017
Merged

Make in-place sed operation portable#2303
istio-merge-robot merged 2 commits intoistio:masterfrom
sdake:fix_update_versions

Conversation

@sdake
Copy link
Copy Markdown
Member

@sdake sdake commented Dec 21, 2017

sed -i is not portable. GNU sed and Darwin have different
operational behaviors. This would not be a problem, however,
homebrew is used occassionally on Darwin, which brings in
GNU sed.

sed -i is not portable.  GNU sed and Darwin have different
operational behaviors.  This would not be a problem, however,
homebrew is used occassionally on Darwin, which brings in
GNU sed.
@istio-testing
Copy link
Copy Markdown
Collaborator

Hi @sdake. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Details

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. I understand the commands that are listed here.

@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 21, 2017

Helm values.yaml does not properly override the proxy tag with -a.
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 21, 2017

Codecov Report

Merging #2303 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2303      +/-   ##
==========================================
- Coverage   78.39%   78.35%   -0.04%     
==========================================
  Files          77       79       +2     
  Lines        7577     7680     +103     
==========================================
+ Hits         5940     6018      +78     
- Misses       1327     1341      +14     
- Partials      310      321      +11
Flag Coverage Δ
#broker 46.09% <ø> (-1.18%) ⬇️
#pilot 79.09% <ø> (-0.12%) ⬇️
#security 87.24% <ø> (-1.91%) ⬇️
Impacted Files Coverage Δ
pilot/adapter/config/memory/monitor.go 81.25% <0%> (-9.38%) ⬇️
pilot/tools/version/version.go
broker/pkg/version/version.go
security/pkg/platform/onprem.go 86.95% <0%> (ø)
security/pkg/platform/gcp.go 94.59% <0%> (ø)
security/pkg/platform/aws.go 65.85% <0%> (ø)
security/pkg/platform/client.go 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8888d4...5bc2062. Read the comment docs.

@sbezverk
Copy link
Copy Markdown
Contributor

@sdake you can check running OS and then use Darwin's version of sed. When you move files you overwrite original file properties.
Check it out:
https://github.com/istio/istio/blob/master/install/updateVersion.sh#L209

@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 21, 2017

That works just fine unless someone has installed homebrew, in which case, the following issue occurs: istio/old_issues_repo#139

@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 21, 2017

/assign @ldemailly

@sbezverk
Copy link
Copy Markdown
Contributor

@sdake I see your point, I still think overwriting files properties is not right thing to do, but I would let community to decide.

@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 21, 2017

you raise a valid point related to file properties. I'll see if there is a way to keep properties intact. which properties concern you most? those shown with stat?

Cheers
-steve

@sbezverk
Copy link
Copy Markdown
Contributor

@sdake After checking the changes again, I see that the operation is done mostly on files located in temp dir with the exception of values.yaml which is not big deal. thanks.

@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 21, 2017

Lars mentioned cat a > b works to preserve properties - so I'll verify that and push a patch later today if it works (or report back that it doesn't).

@ldemailly
Copy link
Copy Markdown
Member

/lgtm

thanks!
(this file should ideally go away soon but for now, this is cleaner/an improvement)

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ldemailly

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@ldemailly
Copy link
Copy Markdown
Member

/test istio-presubmit

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit 034f5f8 into istio:master Dec 21, 2017
@sdake
Copy link
Copy Markdown
Member Author

sdake commented Dec 22, 2017

If the file is headed for the bitbucket (which IMO is a good idea 👍 - no need to gold plate it with keeping properties intact.

Cheers
-steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants