-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NET-6079 - wire up sidecarproxy golden file inputs into xds controlle…
…r - sources (#19241) * NET-5397 - wire up golden tests from sidecar-proxy controller for xds controller and xdsv2 * WIP * WIP * everything matching except leafCerts. need to mock those * single port destinations working except mixed destinations * golden test input to xds controller tests for destinations * proposed fix for failover group naming errors * clean up test to use helper. * clean up test to use helper. * fix test file * add docstring for test function. * add docstring for test function. * fix linting error * fixing test after route fix merged into main * first source test works * WIP * modify all source files * source tests pass * fixing tests after bug fix in main
- Loading branch information
Showing
13 changed files
with
1,929 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...controllers/xds/testdata/source/l4-multiple-workload-addresses-with-specific-ports.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"clusters": { | ||
"local_app:port1": { | ||
"endpointGroup": { | ||
"static": {} | ||
}, | ||
"name": "local_app:port1" | ||
} | ||
}, | ||
"endpoints": { | ||
"local_app:port1": { | ||
"endpoints": [ | ||
{ | ||
"hostPort": { | ||
"host": "127.0.0.1", | ||
"port": 8080 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"identity": { | ||
"name": "test-identity", | ||
"tenancy": { | ||
"namespace": "default", | ||
"partition": "default", | ||
"peerName": "local" | ||
}, | ||
"type": { | ||
"group": "auth", | ||
"groupVersion": "v2beta1", | ||
"kind": "WorkloadIdentity" | ||
} | ||
}, | ||
"listeners": [ | ||
{ | ||
"capabilities": [ | ||
"CAPABILITY_L4_TLS_INSPECTION" | ||
], | ||
"direction": "DIRECTION_INBOUND", | ||
"hostPort": { | ||
"host": "10.0.0.2", | ||
"port": 20000 | ||
}, | ||
"name": "public_listener", | ||
"routers": [ | ||
{ | ||
"inboundTls": { | ||
"inboundMesh": { | ||
"identityKey": "test-identity", | ||
"validationContext": { | ||
"trustBundlePeerNameKeys": [ | ||
"local" | ||
] | ||
} | ||
} | ||
}, | ||
"l4": { | ||
"cluster": { | ||
"name": "local_app:port1" | ||
}, | ||
"statPrefix": "public_listener", | ||
"trafficPermissions": { | ||
"allowPermissions": [ | ||
{ | ||
"principals": [ | ||
{ | ||
"spiffe": { | ||
"regex": "^spiffe://foo.consul/ap/default/ns/default/identity/foo$" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"match": { | ||
"alpnProtocols": [ | ||
"consul~port1" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"trustBundles": { | ||
"local": { | ||
"roots": [ | ||
"some-root", | ||
"some-other-root" | ||
], | ||
"trustDomain": "some-trust-domain" | ||
} | ||
}, | ||
"leafCertificates": { | ||
"test-identity": { | ||
"cert": "-----BEGIN CERTIFICATE-----\nMIICDjCCAbWgAwIBAgIBAjAKBggqhkjOPQQDAjAUMRIwEAYDVQQDEwlUZXN0IENB\nIDEwHhcNMjMxMDE2MTYxMzI5WhcNMjMxMDE2MTYyMzI5WjAAMFkwEwYHKoZIzj0C\nAQYIKoZIzj0DAQcDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9\nta/bGT+5orZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJaOCAQowggEGMA4GA1UdDwEB\n/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDAYDVR0TAQH/\nBAIwADApBgNVHQ4EIgQg3ogXVz9cqaK2B6xdiJYMa5NtT0KkYv7BA2dR7h9EcwUw\nKwYDVR0jBCQwIoAgq+C1mPlPoGa4lt7sSft1goN5qPGyBIB/3mUHJZKSFY8wbwYD\nVR0RAQH/BGUwY4Zhc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9hcC9kZWZhdWx0L25zL2RlZmF1bHQvaWRlbnRpdHkv\ndGVzdC1pZGVudGl0eTAKBggqhkjOPQQDAgNHADBEAiB6L+t5bzRrBPhiQYNeA7fF\nUCuLWrdjW4Xbv3SLg0IKMgIgfRC5hEx+DqzQxTCP4sexX3hVWMjKoWmHdwiUcg+K\n/IE=\n-----END CERTIFICATE-----\n", | ||
"key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFIFkTIL1iUV4O/RpveVHzHs7ZzhSkvYIzbdXDttz9EooAoGCCqGSM49\nAwEHoUQDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9ta/bGT+5\norZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJQ==\n-----END EC PRIVATE KEY-----\n" | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
...ernal/controllers/xds/testdata/source/l4-multiple-workload-addresses-without-ports.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"clusters": { | ||
"local_app:port1": { | ||
"endpointGroup": { | ||
"static": {} | ||
}, | ||
"name": "local_app:port1" | ||
} | ||
}, | ||
"endpoints": { | ||
"local_app:port1": { | ||
"endpoints": [ | ||
{ | ||
"hostPort": { | ||
"host": "127.0.0.1", | ||
"port": 8080 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"identity": { | ||
"name": "test-identity", | ||
"tenancy": { | ||
"namespace": "default", | ||
"partition": "default", | ||
"peerName": "local" | ||
}, | ||
"type": { | ||
"group": "auth", | ||
"groupVersion": "v2beta1", | ||
"kind": "WorkloadIdentity" | ||
} | ||
}, | ||
"listeners": [ | ||
{ | ||
"capabilities": [ | ||
"CAPABILITY_L4_TLS_INSPECTION" | ||
], | ||
"direction": "DIRECTION_INBOUND", | ||
"hostPort": { | ||
"host": "10.0.0.1", | ||
"port": 20000 | ||
}, | ||
"name": "public_listener", | ||
"routers": [ | ||
{ | ||
"inboundTls": { | ||
"inboundMesh": { | ||
"identityKey": "test-identity", | ||
"validationContext": { | ||
"trustBundlePeerNameKeys": [ | ||
"local" | ||
] | ||
} | ||
} | ||
}, | ||
"l4": { | ||
"cluster": { | ||
"name": "local_app:port1" | ||
}, | ||
"statPrefix": "public_listener", | ||
"trafficPermissions": {} | ||
}, | ||
"match": { | ||
"alpnProtocols": [ | ||
"consul~port1" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"trustBundles": { | ||
"local": { | ||
"roots": [ | ||
"some-root", | ||
"some-other-root" | ||
], | ||
"trustDomain": "some-trust-domain" | ||
} | ||
}, | ||
"leafCertificates": { | ||
"test-identity": { | ||
"cert": "-----BEGIN CERTIFICATE-----\nMIICDjCCAbWgAwIBAgIBAjAKBggqhkjOPQQDAjAUMRIwEAYDVQQDEwlUZXN0IENB\nIDEwHhcNMjMxMDE2MTYxMzI5WhcNMjMxMDE2MTYyMzI5WjAAMFkwEwYHKoZIzj0C\nAQYIKoZIzj0DAQcDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9\nta/bGT+5orZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJaOCAQowggEGMA4GA1UdDwEB\n/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDAYDVR0TAQH/\nBAIwADApBgNVHQ4EIgQg3ogXVz9cqaK2B6xdiJYMa5NtT0KkYv7BA2dR7h9EcwUw\nKwYDVR0jBCQwIoAgq+C1mPlPoGa4lt7sSft1goN5qPGyBIB/3mUHJZKSFY8wbwYD\nVR0RAQH/BGUwY4Zhc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9hcC9kZWZhdWx0L25zL2RlZmF1bHQvaWRlbnRpdHkv\ndGVzdC1pZGVudGl0eTAKBggqhkjOPQQDAgNHADBEAiB6L+t5bzRrBPhiQYNeA7fF\nUCuLWrdjW4Xbv3SLg0IKMgIgfRC5hEx+DqzQxTCP4sexX3hVWMjKoWmHdwiUcg+K\n/IE=\n-----END CERTIFICATE-----\n", | ||
"key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFIFkTIL1iUV4O/RpveVHzHs7ZzhSkvYIzbdXDttz9EooAoGCCqGSM49\nAwEHoUQDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9ta/bGT+5\norZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJQ==\n-----END EC PRIVATE KEY-----\n" | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
.../internal/controllers/xds/testdata/source/l4-single-workload-address-without-ports.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"clusters": { | ||
"local_app:port1": { | ||
"endpointGroup": { | ||
"static": {} | ||
}, | ||
"name": "local_app:port1" | ||
} | ||
}, | ||
"endpoints": { | ||
"local_app:port1": { | ||
"endpoints": [ | ||
{ | ||
"hostPort": { | ||
"host": "127.0.0.1", | ||
"port": 8080 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"identity": { | ||
"name": "test-identity", | ||
"tenancy": { | ||
"namespace": "default", | ||
"partition": "default", | ||
"peerName": "local" | ||
}, | ||
"type": { | ||
"group": "auth", | ||
"groupVersion": "v2beta1", | ||
"kind": "WorkloadIdentity" | ||
} | ||
}, | ||
"listeners": [ | ||
{ | ||
"capabilities": [ | ||
"CAPABILITY_L4_TLS_INSPECTION" | ||
], | ||
"direction": "DIRECTION_INBOUND", | ||
"hostPort": { | ||
"host": "10.0.0.1", | ||
"port": 20000 | ||
}, | ||
"name": "public_listener", | ||
"routers": [ | ||
{ | ||
"inboundTls": { | ||
"inboundMesh": { | ||
"identityKey": "test-identity", | ||
"validationContext": { | ||
"trustBundlePeerNameKeys": [ | ||
"local" | ||
] | ||
} | ||
} | ||
}, | ||
"l4": { | ||
"cluster": { | ||
"name": "local_app:port1" | ||
}, | ||
"statPrefix": "public_listener", | ||
"trafficPermissions": {} | ||
}, | ||
"match": { | ||
"alpnProtocols": [ | ||
"consul~port1" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"trustBundles": { | ||
"local": { | ||
"roots": [ | ||
"some-root", | ||
"some-other-root" | ||
], | ||
"trustDomain": "some-trust-domain" | ||
} | ||
}, | ||
"leafCertificates": { | ||
"test-identity": { | ||
"cert": "-----BEGIN CERTIFICATE-----\nMIICDjCCAbWgAwIBAgIBAjAKBggqhkjOPQQDAjAUMRIwEAYDVQQDEwlUZXN0IENB\nIDEwHhcNMjMxMDE2MTYxMzI5WhcNMjMxMDE2MTYyMzI5WjAAMFkwEwYHKoZIzj0C\nAQYIKoZIzj0DAQcDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9\nta/bGT+5orZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJaOCAQowggEGMA4GA1UdDwEB\n/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDAYDVR0TAQH/\nBAIwADApBgNVHQ4EIgQg3ogXVz9cqaK2B6xdiJYMa5NtT0KkYv7BA2dR7h9EcwUw\nKwYDVR0jBCQwIoAgq+C1mPlPoGa4lt7sSft1goN5qPGyBIB/3mUHJZKSFY8wbwYD\nVR0RAQH/BGUwY4Zhc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9hcC9kZWZhdWx0L25zL2RlZmF1bHQvaWRlbnRpdHkv\ndGVzdC1pZGVudGl0eTAKBggqhkjOPQQDAgNHADBEAiB6L+t5bzRrBPhiQYNeA7fF\nUCuLWrdjW4Xbv3SLg0IKMgIgfRC5hEx+DqzQxTCP4sexX3hVWMjKoWmHdwiUcg+K\n/IE=\n-----END CERTIFICATE-----\n", | ||
"key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFIFkTIL1iUV4O/RpveVHzHs7ZzhSkvYIzbdXDttz9EooAoGCCqGSM49\nAwEHoUQDQgAErErAIosDPheZQGbxFQ4hYC/e9Fi4MG9z/zjfCnCq/oK9ta/bGT+5\norZqTmdN/ICsKQDhykxZ2u/Xr6845zhcJQ==\n-----END EC PRIVATE KEY-----\n" | ||
} | ||
} | ||
} |
Oops, something went wrong.