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

make version regex posix compliant so that it works on mac #1279

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

arner
Copy link
Contributor

@arner arner commented Dec 16, 2024

The kubernetes network does not start correctly on Mac due to a different interpretation of the regex by sed.

./test-network-k8s/network 
Fabric image versions: Peer (), CA ()
It seems some of the specified Fabric images are not available.

Examples for testing the fix:

# current: returns empty line on mac
docker run --rm hyperledger/fabric-peer:2.5 peer version | sed -ne 's/^ Version: v\?\(.*\)$/\1/p'

# now: works when executed in the linux OS of the container
docker run --rm hyperledger/fabric-peer:2.5 bash -c "peer version | sed -ne 's/^ Version: v\{0,1\}\(.*\)$/\1/p'"
2.5.9

# works on mac
docker run --rm hyperledger/fabric-peer:2.5 peer version | sed -ne 's/^ Version: v\{0,1\}\(.*\)$/\1/p'
2.5.9

# works without a 'v'
docker run --rm hyperledger/fabric-peer:2.5 bash -c "echo ' Version: 2.5.9' | sed -ne 's/^ Version: v\{0,1\}\(.*\)$/\1/p'"
2.5.9

@arner arner requested a review from a team as a code owner December 16, 2024 19:31
Copy link
Contributor

@denyeart denyeart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Arne!

@denyeart denyeart merged commit 5e0e5a1 into hyperledger:main Dec 16, 2024
38 checks passed
@arner arner deleted the fix-version-regex branch December 16, 2024 21:38
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.

2 participants