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 unit tests with consul 1.13.3 #1720

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions control-plane/connect-inject/endpoints_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func TestProcessUpstreams(t *testing.T) {
},
expErr: "upstream \"upstream1:1234:dc1\" is invalid: ProxyDefaults mesh gateway mode is neither \"local\" nor \"remote\"",
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = "bad-mode"
return pd
Expand Down Expand Up @@ -492,7 +492,7 @@ func TestProcessUpstreams(t *testing.T) {
},
},
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = api.MeshGatewayModeLocal
return pd
Expand All @@ -516,7 +516,7 @@ func TestProcessUpstreams(t *testing.T) {
},
},
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = api.MeshGatewayModeRemote
return pd
Expand All @@ -533,7 +533,7 @@ func TestProcessUpstreams(t *testing.T) {
},
expErr: "",
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = "remote"
return pd
Expand Down Expand Up @@ -634,7 +634,7 @@ func TestProcessUpstreams(t *testing.T) {
return pod1
},
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = "remote"
return pd
Expand Down Expand Up @@ -670,7 +670,7 @@ func TestProcessUpstreams(t *testing.T) {
return pod1
},
configEntry: func() api.ConfigEntry {
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "pd")
ce, _ := api.MakeConfigEntry(api.ProxyDefaults, "global")
pd := ce.(*api.ProxyConfigEntry)
pd.MeshGateway.Mode = "remote"
return pd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func TestReconcile_CreateUpdatePeeringDialer(t *testing.T) {
// must be unique on the acceptor and dialer peers. Otherwise the following consul error will be thrown:
// https://github.com/hashicorp/consul/blob/74b87d49d33069a048aead7a86d85d4b4b6461b5/agent/rpc/peering/service.go#L491.
c.Datacenter = "acceptor-dc"
c.Ports.HTTPS = 0
})
require.NoError(t, err)
defer acceptorPeerServer.Stop()
Expand Down Expand Up @@ -438,6 +439,7 @@ func TestReconcile_VersionAnnotationPeeringDialer(t *testing.T) {
// We set the datacenter because the server name, typically formatted as "server.<datacenter>.<domain>"
// must be unique on the acceptor and dialer peers.
c.Datacenter = "acceptor-dc"
c.Ports.HTTPS = 0
})
require.NoError(t, err)
defer acceptorPeerServer.Stop()
Expand Down