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

Fix some connect connect validation #6575

Merged
merged 3 commits into from
Oct 28, 2019
Merged

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Oct 28, 2019

This fixes two bugs:

  • admission mutators are invoked before validation, so we must handle invalid input in mutation
  • fix validation error aggregation so we always return nil

Sample failure is https://circleci.com/gh/hashicorp/nomad/15559 . The test covers both of these cases, but the panic in one caused test runner to skip running the other failing test case :(.

Fixes #6571

Mahmood Ali added 3 commits October 28, 2019 10:41
`groupConnectHook` assumes that Networks is a non-empty slice, but TG
hasn't been validated yet and validation may depend on mutation results.
As such, we do basic check here before dereferencing network slice
elements.
`admissionValidators` doesn't aggregate errors correctly, as it
aggregates errors in `errs` reference yet it always returns the nil
`err`.

Here, we avoid shadowing `err`, and move variable declarations to where
they are used.
@notnoop notnoop added the theme/consul/connect Consul Connect integration label Oct 28, 2019
@notnoop notnoop added this to the 0.10.1 milestone Oct 28, 2019
@notnoop notnoop requested a review from nickethier October 28, 2019 15:08
@notnoop notnoop merged commit ac44517 into master Oct 28, 2019
@notnoop notnoop deleted the b-gh-6571-missing-service-network branch October 28, 2019 15:45
schmichael pushed a commit that referenced this pull request Oct 31, 2019
…work

Fix some connect connect validation
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/consul/connect Consul Connect integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect stanza panics if network mode is not set to bridge
2 participants