Removes Wild Cloud cruft.
This commit is contained in:
@@ -41,7 +41,7 @@ func TestSanitizeName(t *testing.T) {
|
||||
|
||||
func TestGetListenPorts_BasePorts(t *testing.T) {
|
||||
m := NewManager("")
|
||||
ports := m.GetListenPorts(nil, nil)
|
||||
ports := m.GetListenPorts(nil)
|
||||
want := map[int]bool{80: true, 443: true, 8404: true}
|
||||
for _, p := range ports {
|
||||
delete(want, p)
|
||||
@@ -54,7 +54,7 @@ func TestGetListenPorts_BasePorts(t *testing.T) {
|
||||
func TestGetListenPorts_IncludesCustom(t *testing.T) {
|
||||
m := NewManager("")
|
||||
custom := []CustomRoute{{Name: "ssh", Port: 2222, Backend: "192.168.1.10:22"}}
|
||||
ports := m.GetListenPorts(nil, custom)
|
||||
ports := m.GetListenPorts(custom)
|
||||
found := false
|
||||
for _, p := range ports {
|
||||
if p == 2222 {
|
||||
@@ -94,7 +94,7 @@ func TestGenerate_NoInstances_NoHTTPSFrontend(t *testing.T) {
|
||||
|
||||
func TestGenerate_WithInstance_SNIACLs(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.20", Subdomains: true},
|
||||
}
|
||||
out := m.Generate(instances, nil)
|
||||
@@ -113,7 +113,7 @@ func TestGenerate_WithInstance_SNIACLs(t *testing.T) {
|
||||
|
||||
func TestGenerate_WithInstance_Backend(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.20"},
|
||||
}
|
||||
out := m.Generate(instances, nil)
|
||||
@@ -128,7 +128,7 @@ func TestGenerate_WithInstance_Backend(t *testing.T) {
|
||||
|
||||
func TestGenerate_MultipleInstances(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.20"},
|
||||
{Name: "test-cloud", Domain: "cloud2.payne.io", BackendIP: "192.168.8.30"},
|
||||
}
|
||||
@@ -150,7 +150,7 @@ func TestGenerate_MultipleInstances(t *testing.T) {
|
||||
|
||||
func TestGenerate_WithSubdomains(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.20", Subdomains: true},
|
||||
{Name: "payne-io", Domain: "payne.io", BackendIP: "192.168.8.20", Subdomains: false},
|
||||
}
|
||||
@@ -172,7 +172,7 @@ func TestGenerate_WithSubdomains(t *testing.T) {
|
||||
|
||||
func TestGenerate_ACLOrdering(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.240", Subdomains: true},
|
||||
}
|
||||
httpRoutes := []HTTPRoute{
|
||||
@@ -275,7 +275,7 @@ func TestGenerateWithOpts_HTTPRoutes_L7Frontend(t *testing.T) {
|
||||
|
||||
func TestGenerateWithOpts_MixedL4AndL7(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-cloud", Domain: "cloud.payne.io", BackendIP: "192.168.8.100"},
|
||||
}
|
||||
httpRoutes := []HTTPRoute{
|
||||
@@ -309,7 +309,7 @@ func TestGenerateWithOpts_ACLOrdering_L7BeforeL4Wildcard(t *testing.T) {
|
||||
// wild-cloud.payne.io is an L7 HTTP service. The L7 exact match MUST
|
||||
// appear before the L4 wildcard, otherwise HAProxy matches
|
||||
// wild-cloud.payne.io against *.payne.io and sends it to the wrong backend.
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-io", Domain: "payne.io", BackendIP: "192.168.8.240", Subdomains: true},
|
||||
}
|
||||
httpRoutes := []HTTPRoute{
|
||||
@@ -352,7 +352,7 @@ func TestGenerateWithOpts_ACLOrdering_L7BeforeL4Wildcard(t *testing.T) {
|
||||
|
||||
func TestGenerateWithOpts_SubdomainsFalse_ExactOnly(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "payne-io", Domain: "payne.io", BackendIP: "192.168.8.20", Subdomains: false},
|
||||
}
|
||||
out := m.GenerateWithOpts(instances, nil, GenerateOpts{})
|
||||
@@ -368,7 +368,7 @@ func TestGenerateWithOpts_SubdomainsFalse_ExactOnly(t *testing.T) {
|
||||
|
||||
func TestGenerateWithOpts_SubdomainsTrue_WildcardAndExact(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "cloud-payne", Domain: "cloud.payne.io", BackendIP: "192.168.8.20", Subdomains: true},
|
||||
}
|
||||
out := m.GenerateWithOpts(instances, nil, GenerateOpts{})
|
||||
@@ -390,7 +390,7 @@ func TestGenerateWithOpts_SubdomainsTrue_WildcardAndExact(t *testing.T) {
|
||||
func TestGenerateWithOpts_ACLOrdering_L4ExactBeforeL4Wildcard(t *testing.T) {
|
||||
m := NewManager("")
|
||||
// payne.io exact (subdomains:false) must appear before cloud.payne.io wildcard (subdomains:true)
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "cloud-payne", Domain: "cloud.payne.io", BackendIP: "192.168.8.20", Subdomains: true},
|
||||
{Name: "payne-io", Domain: "payne.io", BackendIP: "192.168.8.20", Subdomains: false},
|
||||
}
|
||||
@@ -412,7 +412,7 @@ func TestGenerateWithOpts_ACLOrdering_L4ExactBeforeL4Wildcard(t *testing.T) {
|
||||
|
||||
func TestGenerateWithOpts_BackwardCompatible(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "test", Domain: "test.example.com", BackendIP: "10.0.0.1"},
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ func TestGenerateWithOpts_OnlyHTTPRoutes(t *testing.T) {
|
||||
func TestGenerateWithOpts_OnlyL4Routes(t *testing.T) {
|
||||
m := NewManager("")
|
||||
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "cloud", Domain: "cloud.example.com", BackendIP: "10.0.0.1", Subdomains: true},
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ func TestGenerateWithOpts_NoL7Fields_BackwardCompat(t *testing.T) {
|
||||
|
||||
func TestGenerateWithOpts_ServiceMarkers(t *testing.T) {
|
||||
m := NewManager("")
|
||||
instances := []InstanceRoute{
|
||||
instances := []L4Route{
|
||||
{Name: "cloud", Domain: "cloud.example.com", BackendIP: "10.0.0.1", Subdomains: true},
|
||||
}
|
||||
httpRoutes := []HTTPRoute{
|
||||
|
||||
Reference in New Issue
Block a user