Skip to content

Commit

Permalink
fix a golden test
Browse files Browse the repository at this point in the history
  • Loading branch information
ndhanushkodi committed Sep 19, 2023
1 parent 2b2d736 commit 150f6b0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
10 changes: 6 additions & 4 deletions agent/xdsv2/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
package xdsv2

import (
"os"
"path/filepath"
"sort"
"testing"

envoy_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
envoy_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"

"github.com/hashicorp/consul/agent/xds/response"
"github.com/hashicorp/consul/envoyextensions/xdscommon"
proxytracker "github.com/hashicorp/consul/internal/mesh/proxy-tracker"
meshv1alpha1 "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
"github.com/hashicorp/consul/sdk/testutil"
"os"
"path/filepath"
"sort"
"testing"

"github.com/stretchr/testify/require"
"google.golang.org/protobuf/encoding/protojson"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"validationContext": {
"spiffeIds": [
"spiffe://foo.consul/ap/default/ns/default/identity/api1-identity"
]
],
"trustBundlePeerNameKey": "local"
},
"sni": "api-1.default.dc1.internal.foo.consul"
},
Expand All @@ -64,7 +65,19 @@
}
}
}
},
"leafCertificates": {
"test-identity": {
"cert": "cert1",
"key": "key1"
}
},
"trustBundles": {
"local": {
"trustDomain": "foo.consul",
"roots": ["root1"]
}
}
},
"requiredEndpoints": {
"api-1.default.dc1.internal.foo.consul": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,42 @@
"ads": {},
"resourceApiVersion": "V3"
}
}
},
"name": "tcp.api-1.default.dc1.internal.foo.consul",
"transportSocket": {
"name": "tls",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext",
"commonTlsContext": {
"alpnProtocols": [
"consul~tcp"
],
"tlsCertificates": [
{
"certificateChain": {
"inlineString": "cert1\n"
},
"privateKey": {
"inlineString": "key1\n"
}
}
],
"tlsParams": {},
"validationContext": {
"matchSubjectAltNames": [
{
"exact": "spiffe://foo.consul/ap/default/ns/default/identity/api1-identity"
}
],
"trustedCa": {
"inlineString": "root1\n"
}
}
},
"sni": "api-1.default.dc1.internal.foo.consul"
}
},
"type": "EDS"
}
],
"typeUrl": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
Expand Down

0 comments on commit 150f6b0

Please sign in to comment.