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

cmd/observe: match only Hubble-specific part of error in Test_getFlowsRequestWithInvalidRawFilters #655

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Dec 6, 2021

protobuf-go deliberately introduces instability into their error message
strings to discourage users from matching on error strings [1]. This
breaks Test_getFlowsRequestWithInvalidRawFilters in unpredictable ways.
This was e.g. the case for #650
where the error message was updated. Due to the instability, he test
again broke on #653

[1] https://github.com/protocolbuffers/protobuf-go/blob/01b51b4f96e6f04345af6153c1b69345f8e075b9/internal/errors/errors.go#L26-L34

Make the test resilient against this behavior by matching only against
the Hubble-specific part of the error string.

Fixes: 18dbc6c ("observe: Add --allowlist / --denylist flags")
Fixes: 771bb4a ("vendor: Bump github.com/cilium/cilium to v1.11.0-rc3")

…sRequestWithInvalidRawFilters

protobuf-go deliberately introduces instability into their error message
strings to discourage users from matching on error strings [1]. This
breaks Test_getFlowsRequestWithInvalidRawFilters in unpredictable ways.
This was e.g. the case for #650
where the error message was updated. Due to the instability, he test
again broke on #653

[1] https://github.com/protocolbuffers/protobuf-go/blob/01b51b4f96e6f04345af6153c1b69345f8e075b9/internal/errors/errors.go#L26-L34

Make the test resilient against this behavior by matching only against
the Hubble-specific part of the error string.

Fixes: 18dbc6c ("observe: Add --allowlist / --denylist flags")
Fixes: 771bb4a ("vendor: Bump github.com/cilium/cilium to v1.11.0-rc3")

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser requested review from a team and jrfastab and removed request for a team December 6, 2021 11:58
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label PR is blocked until the release note is set label Dec 6, 2021
@tklauser tklauser added needs-backport/0.9 This PR needs backporting to the v0.9 branch release-note/bug This PR fixes an issue in a previous release of Hubble. labels Dec 6, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label PR is blocked until the release note is set label Dec 6, 2021
@tklauser tklauser requested review from gandro and removed request for jrfastab December 6, 2021 11:59
Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Thanks a ton!

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Dec 6, 2021
@gandro gandro merged commit da32336 into master Dec 6, 2021
@gandro gandro deleted the pr/tklauser/fix-invalidrawfilters-error-test branch December 6, 2021 12:34
@gandro gandro mentioned this pull request Dec 6, 2021
@tklauser tklauser added backport-pending/0.9 The backport for Hubble 0.9.x for this PR is in progress. and removed needs-backport/0.9 This PR needs backporting to the v0.9 branch labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-pending/0.9 The backport for Hubble 0.9.x for this PR is in progress. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Hubble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants