-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add IPv6 support #37
Add IPv6 support #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM but I'd like to know it's tested before we merge.
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/7de835f5d677447f8e8cda8be0809828 ❌ stf-crc-ocp_412-local_build FAILURE in 21m 52s |
recheck |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/d0ae14586cbd4b9fa39988bf0722d9a0 ❌ stf-crc-ocp_412-local_build RETRY_LIMIT in 19m 09s |
There is some recurring failure in the CI, not related to the timeouts. It seems that the bridge container is constantly failing. See for example https://review.rdoproject.org/zuul/build/e7227852b3a747bf857a1168dddc1c71/log/controller/controller/post_oc_describe_pod_default-cloud1-ceil-event-smartgateway-7b5d4fcd79-5fswr.log in the stf-crc-ocp_414-local_build. We don't really have access to the container logs IIRC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there is something wrong when trying to start the smart-gateway with this change.
6084660
to
07f0cf2
Compare
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/f436f1100762481ab5ca65482b6fbca2 ❌ stf-crc-ocp_412-local_build FAILURE in 21m 11s |
cef5bff
to
3faee27
Compare
This patch makes bridge accept IPv6 addresses as amqp_url value.
The ending of the new regex is the cause of the CI failures. It seems the "[^\\s]" doesn't work as intended instead of matching "non-whitespace" it seems to match "non-'s' character". And because we use "s" in the address in the CI, it fails. Otherwise an impressive work. Thank you. |
I reproduced this locally, if I change /baz to /bas in a unit test I get a segfault instead of a pass. :) I've pushed a commit that fixes this and leaves the /bas version there to prove it. |
bridge.h
Outdated
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))" \ | ||
"?(/[^\\s]*)?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))" \ | |
"?(/[^\\s]*)?$" | |
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))?"\ | |
"(/[^\\s]*)?$" |
Does this violate the linter? It took me a bit longer to parse this with the ?
on the second line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the port # is optional, but there are no unit tests that leave out the port #. FWIW I edited the port and the check for it out of a random test and it worked.
@@ -275,16 +236,21 @@ int main(int argc, char **argv) { | |||
|
|||
match_regex(AMQP_URL_REGEX, matches, 10, app.amqp_con.url); | |||
if (matches[3] != NULL) { | |||
app.amqp_con.user = strdup(matches[2]); | |||
app.amqp_con.user = strdup(matches[3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! This is an old bug that we should have caught in the initial review years ago.
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/0468b5339a1e407786344751d64f5b11 ❌ stf-crc-ocp_412-local_build FAILURE in 23m 51s |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/1863dc58ead042f39b78644968a3275f ❌ stf-crc-ocp_412-local_build FAILURE in 55m 35s |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/5ad98ea6ecc64ee6a0ec29ef18f6ff2a ✔️ stf-crc-ocp_412-local_build SUCCESS in 38m 10s |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/b51d7a850e3c40f28bf8e1afed8106c6 ❌ stf-crc-ocp_412-local_build RETRY_LIMIT in 20m 15s |
recheck |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/839a8cda38ba496786d5c41b4d97f9ee ❌ stf-crc-ocp_412-local_build FAILURE in 23m 48s |
recheck |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/be9f9f5d5f704012a2508d658596583c ❌ stf-crc-ocp_412-local_build FAILURE in 20m 34s |
recheck |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/4083e97099934b15a550a988499978da ❌ stf-crc-ocp_412-local_build FAILURE in 22m 18s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, and thanks so much for enhancing test coverage and automation as well!
* [zuul] Add zuul jobs to sg-bridge (#33) Depends-On: http://github.com/infrawatch/service-telemetry-operator/pull/512 * [zuul] Use the stf-crc-jobs project template (#34) Instead of updating the .zuul.yaml file everytime infrawatch/service-telemetry-operator adds a new job, the project-template can be updated in STO, which will propogate the change to the project and avoid leaving gaps in testing. Depends-On: infrawatch/service-telemetry-operator#514 * Bump actions checkout to v4 (#36) Bump actions checkout to v4 since Node.js 16 actions are deprecated. We need to update to Node.js 20, which is included in actions/checkout@v4. * Rebuild obj files on %.h changes (#38) * Add IPv6 support (#37) * Add IPv6 support This patch makes bridge accept IPv6 addresses as amqp_url value. * Committing clang-format changes * Eliminate implicit-function-declaration in tests * Correct character class in AMQP_URL_REGEX --------- Co-authored-by: InfraWatch CI <[email protected]> Co-authored-by: Chris Sibbitt <[email protected]> Co-authored-by: Victoria Martinez de la Cruz <[email protected]> * Update repo info for opstools (#39) Centos8s went EOL on 31.05.2024 so the packages have been moved to centos vault mirror the repo config we use needs to be updated --------- Co-authored-by: Emma Foley <[email protected]> Co-authored-by: Jaromír Wysoglad <[email protected]> Co-authored-by: Martin Mágr <[email protected]> Co-authored-by: InfraWatch CI <[email protected]> Co-authored-by: Chris Sibbitt <[email protected]>
This patch makes bridge accept IPv6 addresses as amqp_url value.