Skip to content

CRI-O: fix crio_image regexp#944

Merged
stevekuznetsov merged 1 commit into
openshift-eng:masterfrom
runcom:fix-crio-regexp
Dec 15, 2017
Merged

CRI-O: fix crio_image regexp#944
stevekuznetsov merged 1 commit into
openshift-eng:masterfrom
runcom:fix-crio-regexp

Conversation

@runcom
Copy link
Copy Markdown
Contributor

@runcom runcom commented Dec 13, 2017

Make it more robust cause it was failing with weird matches.

@stevekuznetsov @mrunalp PTAL

Signed-off-by: Antonio Murdaca runcom@redhat.com

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 13, 2017
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't need Perl regex for this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And in what case does ORIGIN_PKG_VERSION have more than one line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

never, but if you get "-3.9.0-something3.4-something432" you'll get:
3.9
3.4

so, that's why the head

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's what's happening in openshift/openshift-ansible#6449 for instance

-3.9.0-0.alpha.0.169.a2ec324

$ echo "-3.9.0-0.alpha.0.169.a2ec324" | grep -Po '\d\.\d'        1 ↵
3.9
0.1 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You don't need Perl regex for this

do you have any suggestion about doing this w/o perl regexp? I'll happly use your command

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current regex can be written without Perl syntax, but we can be more specific anyway. It is fair to assume that we could do:

crio_tag="$( grep -Po "(?<=^-)[0-9]+\.[0-9]+" ./ORIGIN_PKG_VERSION )"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed, thanks a ton @stevekuznetsov

@runcom runcom force-pushed the fix-crio-regexp branch 2 times, most recently from 42ae851 to 0fcd3d0 Compare December 14, 2017 14:10
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 14, 2017
@runcom
Copy link
Copy Markdown
Contributor Author

runcom commented Dec 14, 2017

Ping @stevekuznetsov 👼

@stevekuznetsov stevekuznetsov merged commit 378c518 into openshift-eng:master Dec 15, 2017
@stevekuznetsov
Copy link
Copy Markdown
Contributor

$ sjb/push-update-automatic.sh 
[INFO] Checking for existence of test_branch_origin_extended_conformance_crio...
[INFO] Checking for existence of test_pull_request_openshift_ansible_extended_conformance_install_crio...
[INFO] Checking for existence of test_pull_request_origin_extended_conformance_crio...
[INFO] Updating test_branch_origin_extended_conformance_crio...
[INFO] Updating test_pull_request_openshift_ansible_extended_conformance_install_crio...
[INFO] Updating test_pull_request_origin_extended_conformance_crio...

@runcom runcom deleted the fix-crio-regexp branch December 15, 2017 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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