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

networking: fix DNS auto-allocation #52147

Merged
merged 6 commits into from
Jul 18, 2024

Conversation

jewertow
Copy link
Member

@jewertow jewertow commented Jul 18, 2024

Please provide a description of this PR:

I introduced a regression in #51939, because in that PR I set addresses in ClusterVIPs. Previously when ClusterVIPs was empty, function GetAddressForProxy was trying to return auto-allocated address, so I fixed it by setting ClusterVIPs only if addresses are explicitly specified in a ServiceEntry. I also added an integration test.

Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow jewertow requested review from a team as code owners July 18, 2024 09:15
@istio-policy-bot istio-policy-bot added area/networking release-notes-none Indicates a PR that does not require release notes. labels Jul 18, 2024
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 18, 2024
@jewertow jewertow added the cherrypick/release-1.23 Set this label on a PR to auto-merge it to the release-1.23 branch label Jul 18, 2024
@istio-testing istio-testing merged commit 1233285 into istio:master Jul 18, 2024
27 checks passed
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #52147 failed to apply on top of branch "release-1.23":

Applying: Fix returning auto-allocated address
Using index info to reconstruct a base tree...
M	pilot/pkg/model/service_test.go
M	pilot/pkg/serviceregistry/serviceentry/conversion.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/serviceentry/conversion.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/serviceentry/conversion.go
Auto-merging pilot/pkg/model/service_test.go
CONFLICT (content): Merge conflict in pilot/pkg/model/service_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix returning auto-allocated address
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #52150

matchLabels:
app: a
environmentVariables:
ISTIO_META_DNS_CAPTURE: "true"
Copy link
Member

Choose a reason for hiding this comment

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

nit: this shouldn't be needed, the test already has dns allocation enabled globally

@jewertow jewertow added cherrypick/release-1.23 Set this label on a PR to auto-merge it to the release-1.23 branch and removed cherrypick/release-1.23 Set this label on a PR to auto-merge it to the release-1.23 branch labels Jul 23, 2024
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #52279

jewertow added a commit to jewertow/upstream-istio that referenced this pull request Jul 23, 2024
* Fix returning auto-allocated address

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add an integration test

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add missing build tag and license to dns_auto_allocation_test.go

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix unit tests

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add workload selector to ProxyConfig

Signed-off-by: Jacek Ewertowski <[email protected]>

* Trigger injection if ProxyConfig was not propagated

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>
istio-testing pushed a commit that referenced this pull request Jul 26, 2024
…stener (#52283)

* networking: match multiple VIPs in sidecar outbound listener (#51967)

* networking: match multiple addresses in sidecar outbound listener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add unit tests for GetAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor buildSidecarOutboundListener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add an integration test

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add a release note

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor GetAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix linter error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Revert removal svcExtraListenAddresses variable

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix unit tests

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactoring

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix TestEDSOverlapping

Signed-off-by: Jacek Ewertowski <[email protected]>

* Skip testServiceEntryWithMultipleVIPs in ambient mode

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix TestEDSUnhealthyEndpoints

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add test case for ServiceEntry with resolution NONE and multiple VIPs

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix lint error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix linter errors

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix lint error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Generate service with all ports

Signed-off-by: Jacek Ewertowski <[email protected]>

* do not create service instance for each hostname/address pair

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor GetExtraAddressesForProxy and revert removal of its usage from buildSidecarOutboundListener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix listenerBindings.Extra()

Signed-off-by: Jacek Ewertowski <[email protected]>

* Handle IPv6 prefix length

Signed-off-by: Jacek Ewertowski <[email protected]>

* Check address' family only if a proxy supports given family

Signed-off-by: Jacek Ewertowski <[email protected]>

* Update a comment

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor getAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>

* Apply missing changes from #51939

Signed-off-by: Jacek Ewertowski <[email protected]>

* networking: fix DNS auto-allocation (#52147)

* Fix returning auto-allocated address

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add an integration test

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add missing build tag and license to dns_auto_allocation_test.go

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix unit tests

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add workload selector to ProxyConfig

Signed-off-by: Jacek Ewertowski <[email protected]>

* Trigger injection if ProxyConfig was not propagated

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>

* Remove leftovers from conflict resolution

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking cherrypick/release-1.23 Set this label on a PR to auto-merge it to the release-1.23 branch release-notes-none Indicates a PR that does not require release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants