Skip to content

Commit

Permalink
Revert "multi-network: fix eastwest gateway endpoint filtering (istio…
Browse files Browse the repository at this point in the history
…#38762)"

This reverts commit 7f8c1c1.
  • Loading branch information
nmittler committed Jun 7, 2022
1 parent 7888660 commit 87c7e55
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
20 changes: 6 additions & 14 deletions pilot/pkg/xds/endpoint_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ func NewEndpointBuilder(clusterName string, proxy *model.Proxy, push *model.Push
port: port,
}

passthroughMode := model.IsDNSSrvSubsetKey(clusterName)
// We need this for multi-network, or for clusters meant for use with AUTO_PASSTHROUGH.
if features.EnableAutomTLSCheckPolicies ||
b.push.NetworkManager().IsMultiNetworkEnabled() || passthroughMode {
b.mtlsChecker = newMtlsChecker(push, port, dr, passthroughMode)
b.push.NetworkManager().IsMultiNetworkEnabled() || model.IsDNSSrvSubsetKey(clusterName) {
b.mtlsChecker = newMtlsChecker(push, port, dr)
}
return b
}
Expand Down Expand Up @@ -423,26 +422,19 @@ type mtlsChecker struct {
rootPolicyMode *networkingapi.ClientTLSSettings_TLSmode
}

func newMtlsChecker(push *model.PushContext, svcPort int, dr *config.Config, passthroughMode bool) *mtlsChecker {
var rootPolicyMode *networkingapi.ClientTLSSettings_TLSmode
func newMtlsChecker(push *model.PushContext, svcPort int, dr *config.Config) *mtlsChecker {
var drSpec *networkingapi.DestinationRule

// tcp passthrough gateways don't care about client settings
if !passthroughMode {
rootPolicyMode = mtlsModeForDefaultTrafficPolicy(dr, svcPort)
if dr != nil {
drSpec = dr.Spec.(*networkingapi.DestinationRule)
}
if dr != nil {
drSpec = dr.Spec.(*networkingapi.DestinationRule)
}

return &mtlsChecker{
push: push,
svcPort: svcPort,
destinationRule: drSpec,
mtlsDisabledHosts: map[string]struct{}{},
peerAuthDisabledMTLS: map[string]bool{},
subsetPolicyMode: map[string]*networkingapi.ClientTLSSettings_TLSmode{},
rootPolicyMode: rootPolicyMode,
rootPolicyMode: mtlsModeForDefaultTrafficPolicy(dr, svcPort),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/test/framework/components/echo/check/checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func checkReachedNetworks(result echo.CallResult, allClusters cluster.Clusters,
// Verify that all expected networks were reached.
for network := range expectedByNetwork {
if networkHits[network] == 0 {
return fmt.Errorf("did not reach network %q, got %v", network, networkHits)
return fmt.Errorf("did not reach network %v, got %v", network, networkHits)
}
}

Expand Down
7 changes: 0 additions & 7 deletions releasenotes/notes/38704.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,18 @@ spec:
tls:
mode: ISTIO_MUTUAL
---
# TODO(nmittler): Shouldn't need this. Workaround for https://github.com/istio/istio/issues/38704.
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: test-egress
namespace: {{ .SystemNamespace.Name }}
spec:
host: "istio-egressgateway.{{ .SystemNamespace.Name }}.svc.cluster.local"
trafficPolicy:
portLevelSettings:
- port:
number: 443
tls:
mode: ISTIO_MUTUAL
---

0 comments on commit 87c7e55

Please sign in to comment.