mirror of https://github.com/hashicorp/consul
Merge branch 'main' of https://github.com/hashicorp/consul into fix_#20409_chkdef
commit
6bf7e3fc5c
@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
mesh: Fix bug where envoy extensions could not be configured with "permissive" mTLS mode. Note that envoy extensions currently do not apply to non-mTLS traffic in permissive mode.
|
||||
```
|
@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
connect: Fix regression with SAN matching on terminating gateways [GH-20360](https://github.com/hashicorp/consul/issues/20360)
|
||||
```
|
@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
docs: Consul DNS Forwarding configuration for OpenShift update for [Resolve Consul DNS Requests in Kubernetes](https://developer.hashicorp.com/consul/docs/k8s/dns)
|
||||
```
|
@ -0,0 +1,175 @@
|
||||
{
|
||||
"nonce": "00000001",
|
||||
"resources": [
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"altStatName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
|
||||
"circuitBreakers": {},
|
||||
"commonLbConfig": {
|
||||
"healthyPanicThreshold": {}
|
||||
},
|
||||
"connectTimeout": "5s",
|
||||
"edsClusterConfig": {
|
||||
"edsConfig": {
|
||||
"ads": {},
|
||||
"resourceApiVersion": "V3"
|
||||
}
|
||||
},
|
||||
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
|
||||
"outlierDetection": {},
|
||||
"transportSocket": {
|
||||
"name": "tls",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext",
|
||||
"commonTlsContext": {
|
||||
"tlsCertificates": [
|
||||
{
|
||||
"certificateChain": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICjDCCAjKgAwIBAgIIC5llxGV1gB8wCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowDjEMMAoG\nA1UEAxMDd2ViMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEADPv1RHVNRfa2VKR\nAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Favq5E0ivpNtv1QnFhxtPd7d5k4e+T7\nSkW1TaOCAXIwggFuMA4GA1UdDwEB/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcD\nAgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADBoBgNVHQ4EYQRfN2Q6MDc6ODc6M2E6\nNDA6MTk6NDc6YzM6NWE6YzA6YmE6NjI6ZGY6YWY6NGI6ZDQ6MDU6MjU6NzY6M2Q6\nNWE6OGQ6MTY6OGQ6Njc6NWU6MmU6YTA6MzQ6N2Q6ZGM6ZmYwagYDVR0jBGMwYYBf\nZDE6MTE6MTE6YWM6MmE6YmE6OTc6YjI6M2Y6YWM6N2I6YmQ6ZGE6YmU6YjE6OGE6\nZmM6OWE6YmE6YjU6YmM6ODM6ZTc6NWU6NDE6NmY6ZjI6NzM6OTU6NTg6MGM6ZGIw\nWQYDVR0RBFIwUIZOc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9ucy9kZWZhdWx0L2RjL2RjMS9zdmMvd2ViMAoGCCqG\nSM49BAMCA0gAMEUCIGC3TTvvjj76KMrguVyFf4tjOqaSCRie3nmHMRNNRav7AiEA\npY0heYeK9A6iOLrzqxSerkXXQyj5e9bE4VgUnxgPU6g=\n-----END CERTIFICATE-----\n"
|
||||
},
|
||||
"privateKey": {
|
||||
"inlineString": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIMoTkpRggp3fqZzFKh82yS4LjtJI+XY+qX/7DefHFrtdoAoGCCqGSM49\nAwEHoUQDQgAEADPv1RHVNRfa2VKRAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Fav\nq5E0ivpNtv1QnFhxtPd7d5k4e+T7SkW1TQ==\n-----END EC PRIVATE KEY-----\n"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tlsParams": {},
|
||||
"validationContext": {
|
||||
"matchTypedSubjectAltNames": [
|
||||
{
|
||||
"matcher": {
|
||||
"exact": "spiffe://11111111-2222-3333-4444-555555555555.consul/ns/default/dc/dc1/svc/db"
|
||||
},
|
||||
"sanType": "URI"
|
||||
}
|
||||
],
|
||||
"trustedCa": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICXDCCAgKgAwIBAgIICpZq70Z9LyUwCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowFDESMBAG\nA1UEAxMJVGVzdCBDQSAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIhywH1gx\nAsMwuF3ukAI5YL2jFxH6Usnma1HFSfVyxbXX1/uoZEYrj8yCAtdU2yoHETyd+Zx2\nThhRLP79pYegCaOCATwwggE4MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTAD\nAQH/MGgGA1UdDgRhBF9kMToxMToxMTphYzoyYTpiYTo5NzpiMjozZjphYzo3Yjpi\nZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1ZTo0MTo2ZjpmMjo3\nMzo5NTo1ODowYzpkYjBqBgNVHSMEYzBhgF9kMToxMToxMTphYzoyYTpiYTo5Nzpi\nMjozZjphYzo3YjpiZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1\nZTo0MTo2ZjpmMjo3Mzo5NTo1ODowYzpkYjA/BgNVHREEODA2hjRzcGlmZmU6Ly8x\nMTExMTExMS0yMjIyLTMzMzMtNDQ0NC01NTU1NTU1NTU1NTUuY29uc3VsMAoGCCqG\nSM49BAMCA0gAMEUCICOY0i246rQHJt8o8Oya0D5PLL1FnmsQmQqIGCi31RwnAiEA\noR5f6Ku+cig2Il8T8LJujOp2/2A72QcHZA57B13y+8o=\n-----END CERTIFICATE-----\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sni": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
|
||||
}
|
||||
},
|
||||
"type": "EDS"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"circuitBreakers": {},
|
||||
"connectTimeout": "5s",
|
||||
"edsClusterConfig": {
|
||||
"edsConfig": {
|
||||
"ads": {},
|
||||
"resourceApiVersion": "V3"
|
||||
}
|
||||
},
|
||||
"name": "geo-cache.default.dc1.query.11111111-2222-3333-4444-555555555555.consul",
|
||||
"outlierDetection": {},
|
||||
"transportSocket": {
|
||||
"name": "tls",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext",
|
||||
"commonTlsContext": {
|
||||
"tlsCertificates": [
|
||||
{
|
||||
"certificateChain": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICjDCCAjKgAwIBAgIIC5llxGV1gB8wCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowDjEMMAoG\nA1UEAxMDd2ViMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEADPv1RHVNRfa2VKR\nAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Favq5E0ivpNtv1QnFhxtPd7d5k4e+T7\nSkW1TaOCAXIwggFuMA4GA1UdDwEB/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcD\nAgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADBoBgNVHQ4EYQRfN2Q6MDc6ODc6M2E6\nNDA6MTk6NDc6YzM6NWE6YzA6YmE6NjI6ZGY6YWY6NGI6ZDQ6MDU6MjU6NzY6M2Q6\nNWE6OGQ6MTY6OGQ6Njc6NWU6MmU6YTA6MzQ6N2Q6ZGM6ZmYwagYDVR0jBGMwYYBf\nZDE6MTE6MTE6YWM6MmE6YmE6OTc6YjI6M2Y6YWM6N2I6YmQ6ZGE6YmU6YjE6OGE6\nZmM6OWE6YmE6YjU6YmM6ODM6ZTc6NWU6NDE6NmY6ZjI6NzM6OTU6NTg6MGM6ZGIw\nWQYDVR0RBFIwUIZOc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9ucy9kZWZhdWx0L2RjL2RjMS9zdmMvd2ViMAoGCCqG\nSM49BAMCA0gAMEUCIGC3TTvvjj76KMrguVyFf4tjOqaSCRie3nmHMRNNRav7AiEA\npY0heYeK9A6iOLrzqxSerkXXQyj5e9bE4VgUnxgPU6g=\n-----END CERTIFICATE-----\n"
|
||||
},
|
||||
"privateKey": {
|
||||
"inlineString": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIMoTkpRggp3fqZzFKh82yS4LjtJI+XY+qX/7DefHFrtdoAoGCCqGSM49\nAwEHoUQDQgAEADPv1RHVNRfa2VKRAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Fav\nq5E0ivpNtv1QnFhxtPd7d5k4e+T7SkW1TQ==\n-----END EC PRIVATE KEY-----\n"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tlsParams": {},
|
||||
"validationContext": {
|
||||
"matchTypedSubjectAltNames": [
|
||||
{
|
||||
"matcher": {
|
||||
"exact": "spiffe://11111111-2222-3333-4444-555555555555.consul/ns/default/dc/dc1/svc/geo-cache-target"
|
||||
},
|
||||
"sanType": "URI"
|
||||
},
|
||||
{
|
||||
"matcher": {
|
||||
"exact": "spiffe://11111111-2222-3333-4444-555555555555.consul/ns/default/dc/dc2/svc/geo-cache-target"
|
||||
},
|
||||
"sanType": "URI"
|
||||
}
|
||||
],
|
||||
"trustedCa": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICXDCCAgKgAwIBAgIICpZq70Z9LyUwCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowFDESMBAG\nA1UEAxMJVGVzdCBDQSAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIhywH1gx\nAsMwuF3ukAI5YL2jFxH6Usnma1HFSfVyxbXX1/uoZEYrj8yCAtdU2yoHETyd+Zx2\nThhRLP79pYegCaOCATwwggE4MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTAD\nAQH/MGgGA1UdDgRhBF9kMToxMToxMTphYzoyYTpiYTo5NzpiMjozZjphYzo3Yjpi\nZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1ZTo0MTo2ZjpmMjo3\nMzo5NTo1ODowYzpkYjBqBgNVHSMEYzBhgF9kMToxMToxMTphYzoyYTpiYTo5Nzpi\nMjozZjphYzo3YjpiZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1\nZTo0MTo2ZjpmMjo3Mzo5NTo1ODowYzpkYjA/BgNVHREEODA2hjRzcGlmZmU6Ly8x\nMTExMTExMS0yMjIyLTMzMzMtNDQ0NC01NTU1NTU1NTU1NTUuY29uc3VsMAoGCCqG\nSM49BAMCA0gAMEUCICOY0i246rQHJt8o8Oya0D5PLL1FnmsQmQqIGCi31RwnAiEA\noR5f6Ku+cig2Il8T8LJujOp2/2A72QcHZA57B13y+8o=\n-----END CERTIFICATE-----\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sni": "geo-cache.default.dc1.query.11111111-2222-3333-4444-555555555555.consul"
|
||||
}
|
||||
},
|
||||
"type": "EDS"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"connectTimeout": "5s",
|
||||
"loadAssignment": {
|
||||
"clusterName": "local_app",
|
||||
"endpoints": [
|
||||
{
|
||||
"lbEndpoints": [
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "127.0.0.1",
|
||||
"portValue": 8080
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "local_app",
|
||||
"type": "STATIC"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"loadAssignment": {
|
||||
"clusterName": "local_ext_authz",
|
||||
"endpoints": [
|
||||
{
|
||||
"lbEndpoints": [
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "127.0.0.1",
|
||||
"portValue": 9191
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "local_ext_authz",
|
||||
"type": "STATIC",
|
||||
"typedExtensionProtocolOptions": {
|
||||
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
|
||||
"explicitHttpConfig": {
|
||||
"http2ProtocolOptions": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"connectTimeout": "5s",
|
||||
"lbPolicy": "CLUSTER_PROVIDED",
|
||||
"name": "original-destination",
|
||||
"type": "ORIGINAL_DST"
|
||||
}
|
||||
],
|
||||
"typeUrl": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
|
||||
"versionInfo": "00000001"
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
{
|
||||
"nonce": "00000001",
|
||||
"resources": [
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
|
||||
"clusterName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
|
||||
"endpoints": [
|
||||
{
|
||||
"lbEndpoints": [
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "10.10.1.1",
|
||||
"portValue": 8080
|
||||
}
|
||||
}
|
||||
},
|
||||
"healthStatus": "HEALTHY",
|
||||
"loadBalancingWeight": 1
|
||||
},
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "10.10.1.2",
|
||||
"portValue": 8080
|
||||
}
|
||||
}
|
||||
},
|
||||
"healthStatus": "HEALTHY",
|
||||
"loadBalancingWeight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
|
||||
"clusterName": "geo-cache.default.dc1.query.11111111-2222-3333-4444-555555555555.consul",
|
||||
"endpoints": [
|
||||
{
|
||||
"lbEndpoints": [
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "10.10.1.1",
|
||||
"portValue": 8080
|
||||
}
|
||||
}
|
||||
},
|
||||
"healthStatus": "HEALTHY",
|
||||
"loadBalancingWeight": 1
|
||||
},
|
||||
{
|
||||
"endpoint": {
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "10.20.1.2",
|
||||
"portValue": 8080
|
||||
}
|
||||
}
|
||||
},
|
||||
"healthStatus": "HEALTHY",
|
||||
"loadBalancingWeight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"typeUrl": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
|
||||
"versionInfo": "00000001"
|
||||
}
|
@ -0,0 +1,305 @@
|
||||
{
|
||||
"nonce": "00000001",
|
||||
"resources": [
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "127.0.0.1",
|
||||
"portValue": 9191
|
||||
}
|
||||
},
|
||||
"filterChains": [
|
||||
{
|
||||
"filters": [
|
||||
{
|
||||
"name": "envoy.filters.network.tcp_proxy",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
|
||||
"cluster": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
|
||||
"statPrefix": "upstream.db.default.default.dc1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "db:127.0.0.1:9191",
|
||||
"trafficDirection": "OUTBOUND"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "127.0.0.1",
|
||||
"portValue": 1234
|
||||
}
|
||||
},
|
||||
"defaultFilterChain": {
|
||||
"filters": [
|
||||
{
|
||||
"name": "envoy.filters.network.tcp_proxy",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
|
||||
"cluster": "original-destination",
|
||||
"statPrefix": "upstream.original-destination"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"listenerFilters": [
|
||||
{
|
||||
"name": "envoy.filters.listener.original_dst",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "outbound_listener:127.0.0.1:1234",
|
||||
"trafficDirection": "OUTBOUND"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "127.10.10.10",
|
||||
"portValue": 8181
|
||||
}
|
||||
},
|
||||
"filterChains": [
|
||||
{
|
||||
"filters": [
|
||||
{
|
||||
"name": "envoy.filters.network.tcp_proxy",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
|
||||
"cluster": "geo-cache.default.dc1.query.11111111-2222-3333-4444-555555555555.consul",
|
||||
"statPrefix": "upstream.prepared_query_geo-cache"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "prepared_query:geo-cache:127.10.10.10:8181",
|
||||
"trafficDirection": "OUTBOUND"
|
||||
},
|
||||
{
|
||||
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
|
||||
"address": {
|
||||
"socketAddress": {
|
||||
"address": "0.0.0.0",
|
||||
"portValue": 9999
|
||||
}
|
||||
},
|
||||
"filterChains": [
|
||||
{
|
||||
"filters": [
|
||||
{
|
||||
"name": "envoy.filters.network.http_connection_manager",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
|
||||
"forwardClientCertDetails": "APPEND_FORWARD",
|
||||
"httpFilters": [
|
||||
{
|
||||
"name": "envoy.filters.http.rbac",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC",
|
||||
"rules": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "envoy.filters.http.header_to_metadata",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.http.header_to_metadata.v3.Config",
|
||||
"requestRules": [
|
||||
{
|
||||
"header": "x-forwarded-client-cert",
|
||||
"onHeaderPresent": {
|
||||
"key": "trust-domain",
|
||||
"metadataNamespace": "consul",
|
||||
"regexValueRewrite": {
|
||||
"pattern": {
|
||||
"regex": ".*URI=spiffe://([^/]+.[^/]+)(?:/ap/([^/]+))?/ns/([^/]+)/dc/([^/]+)/svc/([^/;,]+).*"
|
||||
},
|
||||
"substitution": "\\1"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"header": "x-forwarded-client-cert",
|
||||
"onHeaderPresent": {
|
||||
"key": "partition",
|
||||
"metadataNamespace": "consul",
|
||||
"regexValueRewrite": {
|
||||
"pattern": {
|
||||
"regex": ".*URI=spiffe://([^/]+.[^/]+)(?:/ap/([^/]+))?/ns/([^/]+)/dc/([^/]+)/svc/([^/;,]+).*"
|
||||
},
|
||||
"substitution": "\\2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"header": "x-forwarded-client-cert",
|
||||
"onHeaderPresent": {
|
||||
"key": "namespace",
|
||||
"metadataNamespace": "consul",
|
||||
"regexValueRewrite": {
|
||||
"pattern": {
|
||||
"regex": ".*URI=spiffe://([^/]+.[^/]+)(?:/ap/([^/]+))?/ns/([^/]+)/dc/([^/]+)/svc/([^/;,]+).*"
|
||||
},
|
||||
"substitution": "\\3"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"header": "x-forwarded-client-cert",
|
||||
"onHeaderPresent": {
|
||||
"key": "datacenter",
|
||||
"metadataNamespace": "consul",
|
||||
"regexValueRewrite": {
|
||||
"pattern": {
|
||||
"regex": ".*URI=spiffe://([^/]+.[^/]+)(?:/ap/([^/]+))?/ns/([^/]+)/dc/([^/]+)/svc/([^/;,]+).*"
|
||||
},
|
||||
"substitution": "\\4"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"header": "x-forwarded-client-cert",
|
||||
"onHeaderPresent": {
|
||||
"key": "service",
|
||||
"metadataNamespace": "consul",
|
||||
"regexValueRewrite": {
|
||||
"pattern": {
|
||||
"regex": ".*URI=spiffe://([^/]+.[^/]+)(?:/ap/([^/]+))?/ns/([^/]+)/dc/([^/]+)/svc/([^/;,]+).*"
|
||||
},
|
||||
"substitution": "\\5"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "envoy.filters.http.ext_authz",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz",
|
||||
"failureModeAllow": true,
|
||||
"grpcService": {
|
||||
"envoyGrpc": {
|
||||
"clusterName": "local_ext_authz"
|
||||
}
|
||||
},
|
||||
"metadataContextNamespaces": [
|
||||
"consul"
|
||||
],
|
||||
"statPrefix": "response",
|
||||
"transportApiVersion": "V3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "envoy.filters.http.router",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
|
||||
}
|
||||
}
|
||||
],
|
||||
"routeConfig": {
|
||||
"name": "public_listener",
|
||||
"virtualHosts": [
|
||||
{
|
||||
"domains": [
|
||||
"*"
|
||||
],
|
||||
"name": "public_listener",
|
||||
"routes": [
|
||||
{
|
||||
"match": {
|
||||
"prefix": "/"
|
||||
},
|
||||
"route": {
|
||||
"cluster": "local_app"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"setCurrentClientCertDetails": {
|
||||
"cert": true,
|
||||
"chain": true,
|
||||
"dns": true,
|
||||
"subject": true,
|
||||
"uri": true
|
||||
},
|
||||
"statPrefix": "public_listener",
|
||||
"tracing": {
|
||||
"randomSampling": {}
|
||||
},
|
||||
"upgradeConfigs": [
|
||||
{
|
||||
"upgradeType": "websocket"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"transportSocket": {
|
||||
"name": "tls",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
|
||||
"commonTlsContext": {
|
||||
"alpnProtocols": [
|
||||
"http/1.1"
|
||||
],
|
||||
"tlsCertificates": [
|
||||
{
|
||||
"certificateChain": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICjDCCAjKgAwIBAgIIC5llxGV1gB8wCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowDjEMMAoG\nA1UEAxMDd2ViMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEADPv1RHVNRfa2VKR\nAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Favq5E0ivpNtv1QnFhxtPd7d5k4e+T7\nSkW1TaOCAXIwggFuMA4GA1UdDwEB/wQEAwIDuDAdBgNVHSUEFjAUBggrBgEFBQcD\nAgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADBoBgNVHQ4EYQRfN2Q6MDc6ODc6M2E6\nNDA6MTk6NDc6YzM6NWE6YzA6YmE6NjI6ZGY6YWY6NGI6ZDQ6MDU6MjU6NzY6M2Q6\nNWE6OGQ6MTY6OGQ6Njc6NWU6MmU6YTA6MzQ6N2Q6ZGM6ZmYwagYDVR0jBGMwYYBf\nZDE6MTE6MTE6YWM6MmE6YmE6OTc6YjI6M2Y6YWM6N2I6YmQ6ZGE6YmU6YjE6OGE6\nZmM6OWE6YmE6YjU6YmM6ODM6ZTc6NWU6NDE6NmY6ZjI6NzM6OTU6NTg6MGM6ZGIw\nWQYDVR0RBFIwUIZOc3BpZmZlOi8vMTExMTExMTEtMjIyMi0zMzMzLTQ0NDQtNTU1\nNTU1NTU1NTU1LmNvbnN1bC9ucy9kZWZhdWx0L2RjL2RjMS9zdmMvd2ViMAoGCCqG\nSM49BAMCA0gAMEUCIGC3TTvvjj76KMrguVyFf4tjOqaSCRie3nmHMRNNRav7AiEA\npY0heYeK9A6iOLrzqxSerkXXQyj5e9bE4VgUnxgPU6g=\n-----END CERTIFICATE-----\n"
|
||||
},
|
||||
"privateKey": {
|
||||
"inlineString": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIMoTkpRggp3fqZzFKh82yS4LjtJI+XY+qX/7DefHFrtdoAoGCCqGSM49\nAwEHoUQDQgAEADPv1RHVNRfa2VKRAB16b6rZnEt7tuhaxCFpQXPj7M2omb0B9Fav\nq5E0ivpNtv1QnFhxtPd7d5k4e+T7SkW1TQ==\n-----END EC PRIVATE KEY-----\n"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tlsParams": {},
|
||||
"validationContext": {
|
||||
"trustedCa": {
|
||||
"inlineString": "-----BEGIN CERTIFICATE-----\nMIICXDCCAgKgAwIBAgIICpZq70Z9LyUwCgYIKoZIzj0EAwIwFDESMBAGA1UEAxMJ\nVGVzdCBDQSAyMB4XDTE5MDMyMjEzNTgyNloXDTI5MDMyMjEzNTgyNlowFDESMBAG\nA1UEAxMJVGVzdCBDQSAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIhywH1gx\nAsMwuF3ukAI5YL2jFxH6Usnma1HFSfVyxbXX1/uoZEYrj8yCAtdU2yoHETyd+Zx2\nThhRLP79pYegCaOCATwwggE4MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTAD\nAQH/MGgGA1UdDgRhBF9kMToxMToxMTphYzoyYTpiYTo5NzpiMjozZjphYzo3Yjpi\nZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1ZTo0MTo2ZjpmMjo3\nMzo5NTo1ODowYzpkYjBqBgNVHSMEYzBhgF9kMToxMToxMTphYzoyYTpiYTo5Nzpi\nMjozZjphYzo3YjpiZDpkYTpiZTpiMTo4YTpmYzo5YTpiYTpiNTpiYzo4MzplNzo1\nZTo0MTo2ZjpmMjo3Mzo5NTo1ODowYzpkYjA/BgNVHREEODA2hjRzcGlmZmU6Ly8x\nMTExMTExMS0yMjIyLTMzMzMtNDQ0NC01NTU1NTU1NTU1NTUuY29uc3VsMAoGCCqG\nSM49BAMCA0gAMEUCICOY0i246rQHJt8o8Oya0D5PLL1FnmsQmQqIGCi31RwnAiEA\noR5f6Ku+cig2Il8T8LJujOp2/2A72QcHZA57B13y+8o=\n-----END CERTIFICATE-----\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requireClientCertificate": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterChainMatch": {
|
||||
"destinationPort": 8080
|
||||
},
|
||||
"filters": [
|
||||
{
|
||||
"name": "envoy.filters.network.tcp_proxy",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
|
||||
"cluster": "local_app",
|
||||
"statPrefix": "permissive_public_listener"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"listenerFilters": [
|
||||
{
|
||||
"name": "envoy.filters.listener.original_dst",
|
||||
"typedConfig": {
|
||||
"@type": "type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "public_listener:0.0.0.0:9999",
|
||||
"trafficDirection": "INBOUND"
|
||||
}
|
||||
],
|
||||
"typeUrl": "type.googleapis.com/envoy.config.listener.v3.Listener",
|
||||
"versionInfo": "00000001"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"nonce": "00000001",
|
||||
"typeUrl": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
|
||||
"versionInfo": "00000001"
|
||||
}
|
@ -1 +1 @@
|
||||
{}
|
||||
{}
|
@ -0,0 +1,221 @@
|
||||
# Controller Testing
|
||||
|
||||
For every controller we want to enable 3 types of testing.
|
||||
|
||||
1. Unit Tests - These should live alongside the controller and utilize mocks and the controller.TestController. Where possible split out controller functionality so that other functions can be independently tested.
|
||||
2. Lightweight integration tests - These should live in an internal/<api group>/<api group>test package. These tests utilize the in-memory resource service and the standard controller manager. There are two types of tests that should be created.
|
||||
* Lifecycle Integration Tests - These go step by step to modify resources and check what the controller did. They are meant to go through the lifecycle of resources and how they are reconciled. Verifications are typically intermingled with resource updates.
|
||||
* One-Shot Integration Tests - These tests publish a bunch of resources and then perform all the verifications. These mainly are focused on the controller eventually converging given all the resources thrown at it and aren't as concerned with any intermediate states resources go through.
|
||||
3. Container based integration tests - These tests live along with our other container based integration tests. They utilize a full multi-node cluster (and sometimes client agents). There are 3 types of tests that can be created here:
|
||||
* Lifecycle Integration Tests - These are the same as for the lighweight integration tests.
|
||||
* One-shot IntegrationTests - These are the same as for the lightweight integration tests.
|
||||
* Upgrade Tests - These are a special form of One-shot Integration tests where the cluster is brought up with some original version, data is pushed in, an upgrade is done and then we verify the consistency of the data post-upgrade.
|
||||
|
||||
|
||||
Between the lightweight and container based integration tests there is a lot of duplication in what is being tested. For this reason these integration test bodies should be defined as exported functions within the apigroups test package. The container based tests can then import those packages and invoke the same functionality with minimal overhead.
|
||||
|
||||
See the [internal/catalog/catalogtest](internal/catalog/catalogtest) package for an example.
|
||||
|
||||
For one-shot integration tests, functions to do the resource publishing should be split from functions to perform the verifications. This allows upgrade tests to publish the resources once pre-upgrade and then validate that their correctness post-upgrade without requiring rewriting them.
|
||||
|
||||
Sometimes it may also be a good idea to export functions in the test packages for running a specific controllers integration tests. This is a good idea when the controller will use a different version of a dependency in Consul Enterprise to allow for the enterprise implementations package to invoke the integration tests after setting up the controller with its injected dependency.
|
||||
|
||||
## Unit Test Template
|
||||
|
||||
These tests live alongside controller source.
|
||||
|
||||
```go
|
||||
package foo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testif/mock"
|
||||
"github.com/stretchr/testif/require"
|
||||
"github.com/stretchr/testif/suite"
|
||||
)
|
||||
|
||||
func TestReconcile(t *testing.T) {
|
||||
rtest.RunWithTenancies(func(tenancy *pbresource.Tenancy) {
|
||||
suite.Run(t, &reconcileSuite{tenancy: tenancy})
|
||||
})
|
||||
}
|
||||
|
||||
type reconcileSuite struct {
|
||||
suite.Suite
|
||||
|
||||
tenancy *pbresource.Tenancy
|
||||
|
||||
ctx context.Context
|
||||
ctl *controller.TestController
|
||||
client *rtest.Client
|
||||
|
||||
// Mock objects needed for testing
|
||||
}
|
||||
|
||||
func (suite *reconcileSuite) SetupTest() {
|
||||
suite.ctx = testutil.TestContext(suite.T())
|
||||
|
||||
// Alternatively it is sometimes useful to use a mock resource service. For that
|
||||
// you can use github.com/hashicorp/consul/grpcmocks.NewResourceServiceClient
|
||||
// to create the client.
|
||||
client := svctest.NewResourceServiceBuilder().
|
||||
// register this API groups types. Also register any other
|
||||
// types this controller depends on.
|
||||
WithRegisterFns(types.Register).
|
||||
WithTenancies(suite.tenancy).
|
||||
Run(suite.T())
|
||||
|
||||
// Build any mock objects or other dependencies of the controller here.
|
||||
|
||||
// Build the TestController
|
||||
suite.ctl = controller.NewTestController(Controller(), client)
|
||||
suite.client = rtest.NewClient(suite.ctl.Runtime().Client)
|
||||
}
|
||||
|
||||
// Implement tests on the suite as needed.
|
||||
func (suite *reconcileSuite) TestSomething() {
|
||||
// Setup Mock expectations
|
||||
|
||||
// Push resources into the resource service as needed.
|
||||
|
||||
// Issue the Reconcile call
|
||||
suite.ctl.Reconcile(suite.ctx, controller.Request{})
|
||||
}
|
||||
```
|
||||
|
||||
## Integration Testing Templates
|
||||
|
||||
These tests should live in internal/<api group>/<api group>test. For these examples, assume the API group under test is named `foo` and the latest API group version is v2.
|
||||
|
||||
### `run_test.go`
|
||||
|
||||
This file is how `go test` knows to execute the tests. These integration tests should
|
||||
be executed against an in-memory resource service with the standard controller manager.
|
||||
|
||||
```go
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package footest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/consul/internal/foo"
|
||||
"github.com/hashicorp/consul/internal/controller/controllertest"
|
||||
"github.com/hashicorp/consul/internal/resource/reaper"
|
||||
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
)
|
||||
|
||||
var (
|
||||
// This makes the CLI options available to control timing delays of requests. The
|
||||
// randomized timings helps to build confidence that regardless of resources writes
|
||||
// occurring in quick succession, the controller under test will eventually converge
|
||||
// on its steady state.
|
||||
clientOpts = rtest.ConfigureTestCLIFlags()
|
||||
)
|
||||
|
||||
func runInMemResourceServiceAndControllers(t *testing.T) pbresource.ResourceServiceClient {
|
||||
t.Helper()
|
||||
|
||||
return controllertest.NewControllerTestBuilder().
|
||||
// Register your types for the API group and any others that these tests will depend on
|
||||
WithResourceRegisterFns(types.Register).
|
||||
WithControllerRegisterFns(
|
||||
reaper.RegisterControllers,
|
||||
foo.RegisterControllers,
|
||||
).Run(t)
|
||||
}
|
||||
|
||||
// The basic integration test should operate mostly in a one-shot manner where resources
|
||||
// are published and then verifications are performed.
|
||||
func TestControllers_Integration(t *testing.T) {
|
||||
client := runInMemResourceServiceAndControllers(t)
|
||||
RunFooV2IntegrationTest(t, client, clientOpts.ClientOptions(t)...)
|
||||
}
|
||||
|
||||
// The lifecycle integration test is typically more complex and deals with changing
|
||||
// some values over time to cause the controllers to do something differently.
|
||||
func TestControllers_Lifecycle(t *testing.T) {
|
||||
client := runInMemResourceServiceAndControllers(t)
|
||||
RunFooV2LifecycleTest(t, client, clientOpts.ClientOptions(t)...)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### `test_integration_v2.go`
|
||||
|
||||
|
||||
```go
|
||||
package footest
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed integration_test_data
|
||||
testData embed.FS
|
||||
)
|
||||
|
||||
// Execute the full integration test
|
||||
func RunFooV2IntegrationTest(t *testing.T, client pbresource.ResourceServiceClient, opts ...rtest.ClientOption) {
|
||||
t.Helper
|
||||
|
||||
PublishFooV2IntegrationTestData(t, client, opts...)
|
||||
VerifyFooV2IntegrationTestResults(t, client)
|
||||
}
|
||||
|
||||
// PublishFooV2IntegrationTestData publishes all the data that needs to exist in the resource service
|
||||
// for the controllers to converge on the desired state.
|
||||
func PublishFooV2IntegrationTestData(t *testing.T, client pbresource.ResourceServiceClient, opts ...rtest.ClientOption) {
|
||||
t.Helper()
|
||||
|
||||
c := rtest.NewClient(client, opts...)
|
||||
|
||||
// Publishing resources manually is an option but alternatively you can store the resources on disk
|
||||
// and use go:embed declarations to embed the whole test data filesystem into the test binary.
|
||||
resources := rtest.ParseResourcesFromFilesystem(t, testData, "integration_test_data/v2")
|
||||
c.PublishResources(t, resources)
|
||||
}
|
||||
|
||||
func VerifyFooV2IntegrationTestResults(t *testing.T, client pbresource.ResourceServiceClient) {
|
||||
t.Helper()
|
||||
|
||||
c := rtest.NewClient(client)
|
||||
|
||||
// Perform verifications here. All verifications should be retryable except in very exceptional circumstances.
|
||||
// This could be in a retry.Run block or could be retryed by using one of the WaitFor* methods on the rtest.Client.
|
||||
// Having them be retryable will prevent flakes especially when the verifications are run in the context of
|
||||
// a multi-server cluster where a raft follower hasn't yet observed some change.
|
||||
}
|
||||
```
|
||||
|
||||
### `test_lifecycle_v2.go`
|
||||
|
||||
```go
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package footest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
)
|
||||
|
||||
func RunFooV2LifecycleIntegrationTest(t *testing.T, client pbresource.ResourceServiceClient, opts ...rtest.ClientOption) {
|
||||
t.Helper()
|
||||
|
||||
// execute tests.
|
||||
}
|
||||
```
|
@ -0,0 +1,168 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package telemetrystate
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/hashicorp/consul/internal/controller"
|
||||
"github.com/hashicorp/consul/internal/controller/dependency"
|
||||
"github.com/hashicorp/consul/internal/hcp/internal/controllers/link"
|
||||
"github.com/hashicorp/consul/internal/hcp/internal/types"
|
||||
"github.com/hashicorp/consul/internal/resource"
|
||||
pbhcp "github.com/hashicorp/consul/proto-public/pbhcp/v2"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
)
|
||||
|
||||
var (
|
||||
globalID = &pbresource.ID{
|
||||
Name: "global",
|
||||
Type: pbhcp.TelemetryStateType,
|
||||
Tenancy: &pbresource.Tenancy{},
|
||||
}
|
||||
)
|
||||
|
||||
const MetaKeyDebugSkipDeletion = StatusKey + "/debug/skip-deletion"
|
||||
|
||||
func TelemetryStateController(hcpClientFn link.HCPClientFn) *controller.Controller {
|
||||
return controller.NewController(StatusKey, pbhcp.TelemetryStateType).
|
||||
WithWatch(pbhcp.LinkType, dependency.ReplaceType(pbhcp.TelemetryStateType)).
|
||||
WithReconciler(&telemetryStateReconciler{
|
||||
hcpClientFn: hcpClientFn,
|
||||
})
|
||||
}
|
||||
|
||||
type telemetryStateReconciler struct {
|
||||
hcpClientFn link.HCPClientFn
|
||||
}
|
||||
|
||||
func (r *telemetryStateReconciler) Reconcile(ctx context.Context, rt controller.Runtime, req controller.Request) error {
|
||||
// The runtime is passed by value so replacing it here for the remainder of this
|
||||
// reconciliation request processing will not affect future invocations.
|
||||
rt.Logger = rt.Logger.With("resource-id", req.ID, "controller", StatusKey)
|
||||
|
||||
rt.Logger.Trace("reconciling telemetry-state")
|
||||
|
||||
// First get the link resource in order to build a hcp client. If the link resource
|
||||
// doesn't exist then the telemetry-state should not exist either.
|
||||
res, err := getLinkResource(ctx, rt)
|
||||
if err != nil {
|
||||
rt.Logger.Error("failed to lookup Link resource", "error", err)
|
||||
return err
|
||||
}
|
||||
if res == nil {
|
||||
return ensureTelemetryStateDeleted(ctx, rt)
|
||||
}
|
||||
|
||||
// Check that the link resource indicates the cluster is linked
|
||||
// If the cluster is not linked, the telemetry-state resource should not exist
|
||||
if linked, reason := link.IsLinked(res.GetResource()); !linked {
|
||||
rt.Logger.Trace("cluster is not linked", "reason", reason)
|
||||
return ensureTelemetryStateDeleted(ctx, rt)
|
||||
}
|
||||
|
||||
hcpClient, err := r.hcpClientFn(link.CloudConfigFromLink(res.GetData()))
|
||||
if err != nil {
|
||||
rt.Logger.Error("error creating HCP Client", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Get the telemetry configuration and observability scoped credentials from hcp
|
||||
tCfg, err := hcpClient.FetchTelemetryConfig(ctx)
|
||||
if err != nil {
|
||||
rt.Logger.Error("error requesting telemetry config", "error", err)
|
||||
return err
|
||||
}
|
||||
clientID, clientSecret, err := hcpClient.GetObservabilitySecret(ctx)
|
||||
if err != nil {
|
||||
rt.Logger.Error("error requesting telemetry credentials", "error", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO allow hcp client config override from hcp TelemetryConfig
|
||||
hcpCfg := res.GetData().GetHcpConfig()
|
||||
|
||||
// TODO implement proxy options from hcp
|
||||
proxyCfg := &pbhcp.ProxyConfig{}
|
||||
|
||||
state := &pbhcp.TelemetryState{
|
||||
ResourceId: res.GetData().ResourceId,
|
||||
ClientId: clientID,
|
||||
ClientSecret: clientSecret,
|
||||
HcpConfig: hcpCfg,
|
||||
Proxy: proxyCfg,
|
||||
Metrics: &pbhcp.MetricsConfig{
|
||||
Labels: tCfg.MetricsConfig.Labels,
|
||||
Disabled: tCfg.MetricsConfig.Disabled,
|
||||
},
|
||||
}
|
||||
|
||||
if tCfg.MetricsConfig.Endpoint != nil {
|
||||
state.Metrics.Endpoint = tCfg.MetricsConfig.Endpoint.String()
|
||||
}
|
||||
if tCfg.MetricsConfig.Filters != nil {
|
||||
state.Metrics.IncludeList = []string{tCfg.MetricsConfig.Filters.String()}
|
||||
}
|
||||
|
||||
stateData, err := anypb.New(state)
|
||||
if err != nil {
|
||||
rt.Logger.Error("error marshalling telemetry-state data", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = rt.Client.Write(ctx, &pbresource.WriteRequest{Resource: &pbresource.Resource{
|
||||
Id: &pbresource.ID{
|
||||
Name: "global",
|
||||
Type: pbhcp.TelemetryStateType,
|
||||
},
|
||||
Data: stateData,
|
||||
}})
|
||||
if err != nil {
|
||||
rt.Logger.Error("error updating telemetry-state", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func ensureTelemetryStateDeleted(ctx context.Context, rt controller.Runtime) error {
|
||||
resp, err := rt.Client.Read(ctx, &pbresource.ReadRequest{Id: &pbresource.ID{Name: "global", Type: pbhcp.TelemetryStateType}})
|
||||
switch {
|
||||
case status.Code(err) == codes.NotFound:
|
||||
return nil
|
||||
case err != nil:
|
||||
rt.Logger.Error("the resource service has returned an unexpected error", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
rt.Logger.Trace("deleting telemetry-state")
|
||||
if _, ok := resp.GetResource().Metadata[MetaKeyDebugSkipDeletion]; ok {
|
||||
rt.Logger.Debug("skip-deletion metadata key found, skipping deletion of telemetry-state resource")
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := rt.Client.Delete(ctx, &pbresource.DeleteRequest{Id: resp.GetResource().GetId()}); err != nil {
|
||||
rt.Logger.Error("error deleting telemetry-state resource", "error", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// getLinkResource returns the cluster scoped pbhcp.Link resource. If the resource is not found a nil
|
||||
// pointer and no error will be returned.
|
||||
func getLinkResource(ctx context.Context, rt controller.Runtime) (*types.DecodedLink, error) {
|
||||
resp, err := rt.Client.Read(ctx, &pbresource.ReadRequest{Id: &pbresource.ID{Name: "global", Type: pbhcp.LinkType}})
|
||||
switch {
|
||||
case status.Code(err) == codes.NotFound:
|
||||
return nil, nil
|
||||
case err != nil:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resource.Decode[*pbhcp.Link](resp.GetResource())
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package telemetrystate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
svctest "github.com/hashicorp/consul/agent/grpc-external/services/resource/testing"
|
||||
hcpclient "github.com/hashicorp/consul/agent/hcp/client"
|
||||
"github.com/hashicorp/consul/agent/hcp/config"
|
||||
"github.com/hashicorp/consul/internal/controller"
|
||||
"github.com/hashicorp/consul/internal/hcp/internal/controllers/link"
|
||||
"github.com/hashicorp/consul/internal/hcp/internal/types"
|
||||
"github.com/hashicorp/consul/internal/resource"
|
||||
rtest "github.com/hashicorp/consul/internal/resource/resourcetest"
|
||||
pbhcp "github.com/hashicorp/consul/proto-public/pbhcp/v2"
|
||||
"github.com/hashicorp/consul/proto-public/pbresource"
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
)
|
||||
|
||||
type controllerSuite struct {
|
||||
suite.Suite
|
||||
|
||||
ctx context.Context
|
||||
client *rtest.Client
|
||||
rt controller.Runtime
|
||||
|
||||
ctl telemetryStateReconciler
|
||||
tenancies []*pbresource.Tenancy
|
||||
}
|
||||
|
||||
func mockHcpClientFn(t *testing.T) (*hcpclient.MockClient, link.HCPClientFn) {
|
||||
mockClient := hcpclient.NewMockClient(t)
|
||||
|
||||
mockClientFunc := func(link config.CloudConfig) (hcpclient.Client, error) {
|
||||
return mockClient, nil
|
||||
}
|
||||
|
||||
return mockClient, mockClientFunc
|
||||
}
|
||||
|
||||
func (suite *controllerSuite) SetupTest() {
|
||||
suite.ctx = testutil.TestContext(suite.T())
|
||||
suite.tenancies = rtest.TestTenancies()
|
||||
client := svctest.NewResourceServiceBuilder().
|
||||
WithRegisterFns(types.Register).
|
||||
WithTenancies(suite.tenancies...).
|
||||
Run(suite.T())
|
||||
|
||||
suite.rt = controller.Runtime{
|
||||
Client: client,
|
||||
Logger: testutil.Logger(suite.T()),
|
||||
}
|
||||
suite.client = rtest.NewClient(client)
|
||||
}
|
||||
|
||||
func TestTelemetryStateController(t *testing.T) {
|
||||
suite.Run(t, new(controllerSuite))
|
||||
}
|
||||
|
||||
func (suite *controllerSuite) deleteResourceFunc(id *pbresource.ID) func() {
|
||||
return func() {
|
||||
suite.client.MustDelete(suite.T(), id)
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *controllerSuite) TestController_Ok() {
|
||||
// Run the controller manager
|
||||
mgr := controller.NewManager(suite.client, suite.rt.Logger)
|
||||
mockClient, mockClientFn := mockHcpClientFn(suite.T())
|
||||
mockClient.EXPECT().FetchTelemetryConfig(mock.Anything).Return(&hcpclient.TelemetryConfig{
|
||||
MetricsConfig: &hcpclient.MetricsConfig{
|
||||
Endpoint: &url.URL{
|
||||
Scheme: "http",
|
||||
Host: "localhost",
|
||||
Path: "/test",
|
||||
},
|
||||
Labels: map[string]string{"foo": "bar"},
|
||||
Filters: regexp.MustCompile(".*"),
|
||||
},
|
||||
RefreshConfig: &hcpclient.RefreshConfig{},
|
||||
}, nil)
|
||||
mockClient.EXPECT().GetObservabilitySecret(mock.Anything).Return("xxx", "yyy", nil)
|
||||
mgr.Register(TelemetryStateController(mockClientFn))
|
||||
mgr.SetRaftLeader(true)
|
||||
go mgr.Run(suite.ctx)
|
||||
|
||||
linkData := &pbhcp.Link{
|
||||
ClientId: "abc",
|
||||
ClientSecret: "abc",
|
||||
ResourceId: types.GenerateTestResourceID(suite.T()),
|
||||
}
|
||||
|
||||
link := rtest.Resource(pbhcp.LinkType, "global").
|
||||
WithData(suite.T(), linkData).
|
||||
WithStatus(link.StatusKey, &pbresource.Status{Conditions: []*pbresource.Condition{link.ConditionLinked(linkData.ResourceId)}}).
|
||||
Write(suite.T(), suite.client)
|
||||
|
||||
suite.T().Cleanup(suite.deleteResourceFunc(link.Id))
|
||||
|
||||
tsRes := suite.client.WaitForResourceExists(suite.T(), &pbresource.ID{Name: "global", Type: pbhcp.TelemetryStateType})
|
||||
decodedState, err := resource.Decode[*pbhcp.TelemetryState](tsRes)
|
||||
require.NoError(suite.T(), err)
|
||||
require.Equal(suite.T(), linkData.ResourceId, decodedState.GetData().ResourceId)
|
||||
require.Equal(suite.T(), "xxx", decodedState.GetData().ClientId)
|
||||
require.Equal(suite.T(), "http://localhost/test", decodedState.GetData().Metrics.Endpoint)
|
||||
|
||||
suite.client.MustDelete(suite.T(), link.Id)
|
||||
suite.client.WaitForDeletion(suite.T(), tsRes.Id)
|
||||
}
|
||||
|
||||
func (suite *controllerSuite) TestController_LinkingDisabled() {
|
||||
// Run the controller manager
|
||||
mgr := controller.NewManager(suite.client, suite.rt.Logger)
|
||||
_, mockClientFn := mockHcpClientFn(suite.T())
|
||||
mgr.Register(TelemetryStateController(mockClientFn))
|
||||
mgr.SetRaftLeader(true)
|
||||
go mgr.Run(suite.ctx)
|
||||
|
||||
linkData := &pbhcp.Link{
|
||||
ClientId: "abc",
|
||||
ClientSecret: "abc",
|
||||
ResourceId: types.GenerateTestResourceID(suite.T()),
|
||||
}
|
||||
|
||||
rtest.Resource(pbhcp.LinkType, "global").
|
||||
WithData(suite.T(), linkData).
|
||||
WithStatus(link.StatusKey, &pbresource.Status{Conditions: []*pbresource.Condition{link.ConditionDisabled}}).
|
||||
Write(suite.T(), suite.client)
|
||||
|
||||
suite.client.WaitForDeletion(suite.T(), &pbresource.ID{Name: "global", Type: pbhcp.TelemetryStateType})
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package telemetrystate
|
||||
|
||||
const (
|
||||
StatusKey = "consul.io/hcp/telemetry-state"
|
||||
)
|
@ -0,0 +1,85 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
|
||||
"github.com/hashicorp/consul/internal/resource"
|
||||
pbhcp "github.com/hashicorp/consul/proto-public/pbhcp/v2"
|
||||
)
|
||||
|
||||
type DecodedTelemetryState = resource.DecodedResource[*pbhcp.TelemetryState]
|
||||
|
||||
var (
|
||||
telemetryStateConfigurationNameError = errors.New("only a single Telemetry resource is allowed and it must be named global")
|
||||
)
|
||||
|
||||
func RegisterTelemetryState(r resource.Registry) {
|
||||
r.Register(resource.Registration{
|
||||
Type: pbhcp.TelemetryStateType,
|
||||
Proto: &pbhcp.TelemetryState{},
|
||||
Scope: resource.ScopeCluster,
|
||||
Validate: ValidateTelemetryState,
|
||||
})
|
||||
}
|
||||
|
||||
var ValidateTelemetryState = resource.DecodeAndValidate(validateTelemetryState)
|
||||
|
||||
func validateTelemetryState(res *DecodedTelemetryState) error {
|
||||
var err error
|
||||
|
||||
if res.GetId().GetName() != "global" {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "name",
|
||||
Wrapped: telemetryStateConfigurationNameError,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetClientId() == "" {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "client_id",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetClientSecret() == "" {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "client_secret",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetResourceId() == "" {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "resource_id",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetMetrics().GetEndpoint() == "" {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "metrics.endpoint",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetMetrics().GetIncludeList() == nil {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "metrics.include_list",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
if res.GetData().GetMetrics().GetLabels() == nil {
|
||||
err = multierror.Append(err, resource.ErrInvalidField{
|
||||
Name: "metrics.labels",
|
||||
Wrapped: resource.ErrMissing,
|
||||
})
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/internal/resource"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/consul/internal/resource/resourcetest"
|
||||
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestValidateMeshGateway(t *testing.T) {
|
||||
type testcase struct {
|
||||
mgwName string
|
||||
mgw *pbmesh.MeshGateway
|
||||
expectErr string
|
||||
}
|
||||
|
||||
run := func(t *testing.T, tc testcase) {
|
||||
res := resourcetest.Resource(pbmesh.MeshGatewayType, tc.mgwName).
|
||||
WithData(t, tc.mgw).
|
||||
Build()
|
||||
|
||||
err := resource.DecodeAndValidate(validateMeshGateway)(res)
|
||||
|
||||
if tc.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
} else {
|
||||
testutil.RequireErrorContains(t, err, tc.expectErr)
|
||||
}
|
||||
}
|
||||
|
||||
cases := map[string]testcase{
|
||||
"happy path": {
|
||||
mgwName: "mesh-gateway",
|
||||
mgw: &pbmesh.MeshGateway{
|
||||
Listeners: []*pbmesh.MeshGatewayListener{
|
||||
{
|
||||
Name: "wan",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectErr: "",
|
||||
},
|
||||
"wrong name for mesh-gateway": {
|
||||
mgwName: "my-mesh-gateway",
|
||||
mgw: &pbmesh.MeshGateway{
|
||||
Listeners: []*pbmesh.MeshGatewayListener{
|
||||
{
|
||||
Name: "wan",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectErr: "invalid gateway name, must be \"mesh-gateway\"",
|
||||
},
|
||||
"too many listeners on mesh-gateway": {
|
||||
mgwName: "mesh-gateway",
|
||||
mgw: &pbmesh.MeshGateway{
|
||||
Listeners: []*pbmesh.MeshGatewayListener{
|
||||
{
|
||||
Name: "obi",
|
||||
},
|
||||
{
|
||||
Name: "wan",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectErr: "invalid listeners, must have exactly one listener",
|
||||
},
|
||||
"zero listeners on mesh-gateway": {
|
||||
mgwName: "mesh-gateway",
|
||||
mgw: &pbmesh.MeshGateway{},
|
||||
expectErr: "invalid listeners, must have exactly one listener",
|
||||
},
|
||||
"incorrect listener name on mesh-gateway": {
|
||||
mgwName: "mesh-gateway",
|
||||
mgw: &pbmesh.MeshGateway{
|
||||
Listeners: []*pbmesh.MeshGatewayListener{
|
||||
{
|
||||
Name: "kenobi",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectErr: "invalid listener name, must be \"wan\"",
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
run(t, tc)
|
||||
})
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// Code generated by protoc-gen-go-binary. DO NOT EDIT.
|
||||
// source: pbhcp/v2/hcp_config.proto
|
||||
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// MarshalBinary implements encoding.BinaryMarshaler
|
||||
func (msg *HCPConfig) MarshalBinary() ([]byte, error) {
|
||||
return proto.Marshal(msg)
|
||||
}
|
||||
|
||||
// UnmarshalBinary implements encoding.BinaryUnmarshaler
|
||||
func (msg *HCPConfig) UnmarshalBinary(b []byte) error {
|
||||
return proto.Unmarshal(b, msg)
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: pbhcp/v2/hcp_config.proto
|
||||
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// HCPConfig is used to configure the HCP SDK for communicating with
|
||||
// the HashiCorp Cloud Platform. All configuration is optional with default
|
||||
// values provided by the SDK.
|
||||
type HCPConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// AuthUrl is the URL which will be used to authenticate.
|
||||
AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"`
|
||||
// ApiAddress is the address (<hostname>[:port]) of the HCP api.
|
||||
ApiAddress string `protobuf:"bytes,2,opt,name=api_address,json=apiAddress,proto3" json:"api_address,omitempty"`
|
||||
// ScadaAddress is the address (<hostname>[:port]) of the HCP SCADA endpoint.
|
||||
ScadaAddress string `protobuf:"bytes,3,opt,name=scada_address,json=scadaAddress,proto3" json:"scada_address,omitempty"`
|
||||
// TlsInsecureSkipVerify if true will ignore server name verification when making HTTPS requests
|
||||
TlsInsecureSkipVerify bool `protobuf:"varint,4,opt,name=tls_insecure_skip_verify,json=tlsInsecureSkipVerify,proto3" json:"tls_insecure_skip_verify,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HCPConfig) Reset() {
|
||||
*x = HCPConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbhcp_v2_hcp_config_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HCPConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HCPConfig) ProtoMessage() {}
|
||||
|
||||
func (x *HCPConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbhcp_v2_hcp_config_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HCPConfig.ProtoReflect.Descriptor instead.
|
||||
func (*HCPConfig) Descriptor() ([]byte, []int) {
|
||||
return file_pbhcp_v2_hcp_config_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HCPConfig) GetAuthUrl() string {
|
||||
if x != nil {
|
||||
return x.AuthUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HCPConfig) GetApiAddress() string {
|
||||
if x != nil {
|
||||
return x.ApiAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HCPConfig) GetScadaAddress() string {
|
||||
if x != nil {
|
||||
return x.ScadaAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HCPConfig) GetTlsInsecureSkipVerify() bool {
|
||||
if x != nil {
|
||||
return x.TlsInsecureSkipVerify
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_pbhcp_v2_hcp_config_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pbhcp_v2_hcp_config_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x70, 0x62, 0x68, 0x63, 0x70, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x70, 0x5f, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63,
|
||||
0x70, 0x2e, 0x76, 0x32, 0x22, 0xa5, 0x01, 0x0a, 0x09, 0x48, 0x43, 0x50, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a,
|
||||
0x0b, 0x61, 0x70, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23,
|
||||
0x0a, 0x0d, 0x73, 0x63, 0x61, 0x64, 0x61, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x61, 0x64, 0x61, 0x41, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x74, 0x6c, 0x73, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x63,
|
||||
0x75, 0x72, 0x65, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x74, 0x6c, 0x73, 0x49, 0x6e, 0x73, 0x65, 0x63, 0x75,
|
||||
0x72, 0x65, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0xe5, 0x01, 0x0a,
|
||||
0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63, 0x70, 0x2e, 0x76, 0x32, 0x42, 0x0e, 0x48, 0x63,
|
||||
0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69,
|
||||
0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x70, 0x62, 0x68, 0x63, 0x70, 0x2f, 0x76,
|
||||
0x32, 0x3b, 0x68, 0x63, 0x70, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x48, 0x43, 0x48, 0xaa, 0x02, 0x17,
|
||||
0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c,
|
||||
0x2e, 0x48, 0x63, 0x70, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x17, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63,
|
||||
0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x48, 0x63, 0x70, 0x5c, 0x56,
|
||||
0x32, 0xe2, 0x02, 0x23, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f,
|
||||
0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x48, 0x63, 0x70, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63,
|
||||
0x6f, 0x72, 0x70, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x48, 0x63, 0x70,
|
||||
0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pbhcp_v2_hcp_config_proto_rawDescOnce sync.Once
|
||||
file_pbhcp_v2_hcp_config_proto_rawDescData = file_pbhcp_v2_hcp_config_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pbhcp_v2_hcp_config_proto_rawDescGZIP() []byte {
|
||||
file_pbhcp_v2_hcp_config_proto_rawDescOnce.Do(func() {
|
||||
file_pbhcp_v2_hcp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbhcp_v2_hcp_config_proto_rawDescData)
|
||||
})
|
||||
return file_pbhcp_v2_hcp_config_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pbhcp_v2_hcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_pbhcp_v2_hcp_config_proto_goTypes = []interface{}{
|
||||
(*HCPConfig)(nil), // 0: hashicorp.consul.hcp.v2.HCPConfig
|
||||
}
|
||||
var file_pbhcp_v2_hcp_config_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pbhcp_v2_hcp_config_proto_init() }
|
||||
func file_pbhcp_v2_hcp_config_proto_init() {
|
||||
if File_pbhcp_v2_hcp_config_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pbhcp_v2_hcp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*HCPConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pbhcp_v2_hcp_config_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_pbhcp_v2_hcp_config_proto_goTypes,
|
||||
DependencyIndexes: file_pbhcp_v2_hcp_config_proto_depIdxs,
|
||||
MessageInfos: file_pbhcp_v2_hcp_config_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pbhcp_v2_hcp_config_proto = out.File
|
||||
file_pbhcp_v2_hcp_config_proto_rawDesc = nil
|
||||
file_pbhcp_v2_hcp_config_proto_goTypes = nil
|
||||
file_pbhcp_v2_hcp_config_proto_depIdxs = nil
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package hashicorp.consul.hcp.v2;
|
||||
|
||||
// HCPConfig is used to configure the HCP SDK for communicating with
|
||||
// the HashiCorp Cloud Platform. All configuration is optional with default
|
||||
// values provided by the SDK.
|
||||
message HCPConfig {
|
||||
// AuthUrl is the URL which will be used to authenticate.
|
||||
string auth_url = 1;
|
||||
|
||||
// ApiAddress is the address (<hostname>[:port]) of the HCP api.
|
||||
string api_address = 2;
|
||||
|
||||
// ScadaAddress is the address (<hostname>[:port]) of the HCP SCADA endpoint.
|
||||
string scada_address = 3;
|
||||
|
||||
// TlsInsecureSkipVerify if true will ignore server name verification when making HTTPS requests
|
||||
bool tls_insecure_skip_verify = 4;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
// Code generated by protoc-gen-deepcopy. DO NOT EDIT.
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// DeepCopyInto supports using HCPConfig within kubernetes types, where deepcopy-gen is used.
|
||||
func (in *HCPConfig) DeepCopyInto(out *HCPConfig) {
|
||||
proto.Reset(out)
|
||||
proto.Merge(out, proto.Clone(in))
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HCPConfig. Required by controller-gen.
|
||||
func (in *HCPConfig) DeepCopy() *HCPConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HCPConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HCPConfig. Required by controller-gen.
|
||||
func (in *HCPConfig) DeepCopyInterface() interface{} {
|
||||
return in.DeepCopy()
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Code generated by protoc-json-shim. DO NOT EDIT.
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
// MarshalJSON is a custom marshaler for HCPConfig
|
||||
func (this *HCPConfig) MarshalJSON() ([]byte, error) {
|
||||
str, err := HcpConfigMarshaler.Marshal(this)
|
||||
return []byte(str), err
|
||||
}
|
||||
|
||||
// UnmarshalJSON is a custom unmarshaler for HCPConfig
|
||||
func (this *HCPConfig) UnmarshalJSON(b []byte) error {
|
||||
return HcpConfigUnmarshaler.Unmarshal(b, this)
|
||||
}
|
||||
|
||||
var (
|
||||
HcpConfigMarshaler = &protojson.MarshalOptions{}
|
||||
HcpConfigUnmarshaler = &protojson.UnmarshalOptions{DiscardUnknown: false}
|
||||
)
|
@ -0,0 +1,38 @@
|
||||
// Code generated by protoc-gen-go-binary. DO NOT EDIT.
|
||||
// source: pbhcp/v2/telemetry_state.proto
|
||||
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// MarshalBinary implements encoding.BinaryMarshaler
|
||||
func (msg *TelemetryState) MarshalBinary() ([]byte, error) {
|
||||
return proto.Marshal(msg)
|
||||
}
|
||||
|
||||
// UnmarshalBinary implements encoding.BinaryUnmarshaler
|
||||
func (msg *TelemetryState) UnmarshalBinary(b []byte) error {
|
||||
return proto.Unmarshal(b, msg)
|
||||
}
|
||||
|
||||
// MarshalBinary implements encoding.BinaryMarshaler
|
||||
func (msg *MetricsConfig) MarshalBinary() ([]byte, error) {
|
||||
return proto.Marshal(msg)
|
||||
}
|
||||
|
||||
// UnmarshalBinary implements encoding.BinaryUnmarshaler
|
||||
func (msg *MetricsConfig) UnmarshalBinary(b []byte) error {
|
||||
return proto.Unmarshal(b, msg)
|
||||
}
|
||||
|
||||
// MarshalBinary implements encoding.BinaryMarshaler
|
||||
func (msg *ProxyConfig) MarshalBinary() ([]byte, error) {
|
||||
return proto.Marshal(msg)
|
||||
}
|
||||
|
||||
// UnmarshalBinary implements encoding.BinaryUnmarshaler
|
||||
func (msg *ProxyConfig) UnmarshalBinary(b []byte) error {
|
||||
return proto.Unmarshal(b, msg)
|
||||
}
|
@ -0,0 +1,426 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: pbhcp/v2/telemetry_state.proto
|
||||
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
_ "github.com/hashicorp/consul/proto-public/pbresource"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// TelemetryState describes configuration required to forward telemetry to the HashiCorp Cloud Platform.
|
||||
// This resource is managed internally and is only written if the cluster is linked to HCP. Any
|
||||
// manual changes to the resource will be reconciled and overwritten with the internally computed
|
||||
// state.
|
||||
type TelemetryState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// ResourceId is the identifier for the cluster linked with HCP.
|
||||
ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
|
||||
// ClientId is the oauth client identifier for cluster.
|
||||
// This client has capabilities limited to writing telemetry data for this cluster.
|
||||
ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
|
||||
// ClientSecret is the oauth secret used to authenticate requests to send telemetry data to HCP.
|
||||
ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
|
||||
HcpConfig *HCPConfig `protobuf:"bytes,4,opt,name=hcp_config,json=hcpConfig,proto3" json:"hcp_config,omitempty"`
|
||||
Proxy *ProxyConfig `protobuf:"bytes,5,opt,name=proxy,proto3" json:"proxy,omitempty"`
|
||||
Metrics *MetricsConfig `protobuf:"bytes,6,opt,name=metrics,proto3" json:"metrics,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TelemetryState) Reset() {
|
||||
*x = TelemetryState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TelemetryState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TelemetryState) ProtoMessage() {}
|
||||
|
||||
func (x *TelemetryState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TelemetryState.ProtoReflect.Descriptor instead.
|
||||
func (*TelemetryState) Descriptor() ([]byte, []int) {
|
||||
return file_pbhcp_v2_telemetry_state_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetResourceId() string {
|
||||
if x != nil {
|
||||
return x.ResourceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetClientId() string {
|
||||
if x != nil {
|
||||
return x.ClientId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetClientSecret() string {
|
||||
if x != nil {
|
||||
return x.ClientSecret
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetHcpConfig() *HCPConfig {
|
||||
if x != nil {
|
||||
return x.HcpConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetProxy() *ProxyConfig {
|
||||
if x != nil {
|
||||
return x.Proxy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TelemetryState) GetMetrics() *MetricsConfig {
|
||||
if x != nil {
|
||||
return x.Metrics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MetricsConfig configures metric specific collection details
|
||||
type MetricsConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Endpoint is the HTTPS address and path to forward metrics to
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
|
||||
// IncludeList contains patterns to match against metric names. Only matched metrics are forwarded.
|
||||
IncludeList []string `protobuf:"bytes,2,rep,name=include_list,json=includeList,proto3" json:"include_list,omitempty"`
|
||||
// Labels contains key value pairs that are associated with all metrics collected and fowarded.
|
||||
Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
// Disabled toggles metric forwarding. If true, metric forwarding will stop until disabled is set to false.
|
||||
Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) Reset() {
|
||||
*x = MetricsConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MetricsConfig) ProtoMessage() {}
|
||||
|
||||
func (x *MetricsConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MetricsConfig.ProtoReflect.Descriptor instead.
|
||||
func (*MetricsConfig) Descriptor() ([]byte, []int) {
|
||||
return file_pbhcp_v2_telemetry_state_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) GetEndpoint() string {
|
||||
if x != nil {
|
||||
return x.Endpoint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) GetIncludeList() []string {
|
||||
if x != nil {
|
||||
return x.IncludeList
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) GetLabels() map[string]string {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MetricsConfig) GetDisabled() bool {
|
||||
if x != nil {
|
||||
return x.Disabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ProxyConfig describes configuration for forwarding requests through an http proxy
|
||||
type ProxyConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// HttpProxy configures the http proxy to use for HTTP (non-TLS) requests.
|
||||
HttpProxy string `protobuf:"bytes,1,opt,name=http_proxy,json=httpProxy,proto3" json:"http_proxy,omitempty"`
|
||||
// HttpsProxy configures the http proxy to use for HTTPS (TLS) requests.
|
||||
HttpsProxy string `protobuf:"bytes,2,opt,name=https_proxy,json=httpsProxy,proto3" json:"https_proxy,omitempty"`
|
||||
// NoProxy can be configured to include domains which should NOT be forwarded through the configured http proxy
|
||||
NoProxy []string `protobuf:"bytes,3,rep,name=no_proxy,json=noProxy,proto3" json:"no_proxy,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProxyConfig) Reset() {
|
||||
*x = ProxyConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProxyConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProxyConfig) ProtoMessage() {}
|
||||
|
||||
func (x *ProxyConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbhcp_v2_telemetry_state_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProxyConfig.ProtoReflect.Descriptor instead.
|
||||
func (*ProxyConfig) Descriptor() ([]byte, []int) {
|
||||
return file_pbhcp_v2_telemetry_state_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ProxyConfig) GetHttpProxy() string {
|
||||
if x != nil {
|
||||
return x.HttpProxy
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ProxyConfig) GetHttpsProxy() string {
|
||||
if x != nil {
|
||||
return x.HttpsProxy
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ProxyConfig) GetNoProxy() []string {
|
||||
if x != nil {
|
||||
return x.NoProxy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_pbhcp_v2_telemetry_state_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pbhcp_v2_telemetry_state_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x70, 0x62, 0x68, 0x63, 0x70, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d,
|
||||
0x65, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x17, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73,
|
||||
0x75, 0x6c, 0x2e, 0x68, 0x63, 0x70, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x70, 0x62, 0x68, 0x63, 0x70,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0xbc, 0x02, 0x0a, 0x0e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,
|
||||
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e,
|
||||
0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65,
|
||||
0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65,
|
||||
0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x41, 0x0a, 0x0a, 0x68, 0x63, 0x70, 0x5f,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x68,
|
||||
0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e,
|
||||
0x68, 0x63, 0x70, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x43, 0x50, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x52, 0x09, 0x68, 0x63, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x05, 0x70,
|
||||
0x72, 0x6f, 0x78, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63,
|
||||
0x70, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x52, 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69,
|
||||
0x63, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69,
|
||||
0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63, 0x70, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x3a, 0x06, 0xa2, 0x93, 0x04, 0x02, 0x08,
|
||||
0x01, 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12,
|
||||
0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x12, 0x4a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x32, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63, 0x70, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74,
|
||||
0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c,
|
||||
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1a,
|
||||
0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61,
|
||||
0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x68, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, 0x6f,
|
||||
0x78, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, 0x50, 0x72,
|
||||
0x6f, 0x78, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x5f, 0x70, 0x72, 0x6f,
|
||||
0x78, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x73, 0x50,
|
||||
0x72, 0x6f, 0x78, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x42,
|
||||
0xea, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
|
||||
0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x68, 0x63, 0x70, 0x2e, 0x76, 0x32, 0x42,
|
||||
0x13, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||
0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x6f, 0x6e,
|
||||
0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
|
||||
0x2f, 0x70, 0x62, 0x68, 0x63, 0x70, 0x2f, 0x76, 0x32, 0x3b, 0x68, 0x63, 0x70, 0x76, 0x32, 0xa2,
|
||||
0x02, 0x03, 0x48, 0x43, 0x48, 0xaa, 0x02, 0x17, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
|
||||
0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x48, 0x63, 0x70, 0x2e, 0x56, 0x32, 0xca,
|
||||
0x02, 0x17, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73,
|
||||
0x75, 0x6c, 0x5c, 0x48, 0x63, 0x70, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x23, 0x48, 0x61, 0x73, 0x68,
|
||||
0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x48, 0x63, 0x70,
|
||||
0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x1a, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x3a, 0x3a, 0x43, 0x6f, 0x6e,
|
||||
0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x48, 0x63, 0x70, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pbhcp_v2_telemetry_state_proto_rawDescOnce sync.Once
|
||||
file_pbhcp_v2_telemetry_state_proto_rawDescData = file_pbhcp_v2_telemetry_state_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pbhcp_v2_telemetry_state_proto_rawDescGZIP() []byte {
|
||||
file_pbhcp_v2_telemetry_state_proto_rawDescOnce.Do(func() {
|
||||
file_pbhcp_v2_telemetry_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbhcp_v2_telemetry_state_proto_rawDescData)
|
||||
})
|
||||
return file_pbhcp_v2_telemetry_state_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pbhcp_v2_telemetry_state_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_pbhcp_v2_telemetry_state_proto_goTypes = []interface{}{
|
||||
(*TelemetryState)(nil), // 0: hashicorp.consul.hcp.v2.TelemetryState
|
||||
(*MetricsConfig)(nil), // 1: hashicorp.consul.hcp.v2.MetricsConfig
|
||||
(*ProxyConfig)(nil), // 2: hashicorp.consul.hcp.v2.ProxyConfig
|
||||
nil, // 3: hashicorp.consul.hcp.v2.MetricsConfig.LabelsEntry
|
||||
(*HCPConfig)(nil), // 4: hashicorp.consul.hcp.v2.HCPConfig
|
||||
}
|
||||
var file_pbhcp_v2_telemetry_state_proto_depIdxs = []int32{
|
||||
4, // 0: hashicorp.consul.hcp.v2.TelemetryState.hcp_config:type_name -> hashicorp.consul.hcp.v2.HCPConfig
|
||||
2, // 1: hashicorp.consul.hcp.v2.TelemetryState.proxy:type_name -> hashicorp.consul.hcp.v2.ProxyConfig
|
||||
1, // 2: hashicorp.consul.hcp.v2.TelemetryState.metrics:type_name -> hashicorp.consul.hcp.v2.MetricsConfig
|
||||
3, // 3: hashicorp.consul.hcp.v2.MetricsConfig.labels:type_name -> hashicorp.consul.hcp.v2.MetricsConfig.LabelsEntry
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pbhcp_v2_telemetry_state_proto_init() }
|
||||
func file_pbhcp_v2_telemetry_state_proto_init() {
|
||||
if File_pbhcp_v2_telemetry_state_proto != nil {
|
||||
return
|
||||
}
|
||||
file_pbhcp_v2_hcp_config_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pbhcp_v2_telemetry_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TelemetryState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pbhcp_v2_telemetry_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MetricsConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pbhcp_v2_telemetry_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProxyConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pbhcp_v2_telemetry_state_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_pbhcp_v2_telemetry_state_proto_goTypes,
|
||||
DependencyIndexes: file_pbhcp_v2_telemetry_state_proto_depIdxs,
|
||||
MessageInfos: file_pbhcp_v2_telemetry_state_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pbhcp_v2_telemetry_state_proto = out.File
|
||||
file_pbhcp_v2_telemetry_state_proto_rawDesc = nil
|
||||
file_pbhcp_v2_telemetry_state_proto_goTypes = nil
|
||||
file_pbhcp_v2_telemetry_state_proto_depIdxs = nil
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hashicorp.consul.hcp.v2;
|
||||
|
||||
import "pbhcp/v2/hcp_config.proto";
|
||||
import "pbresource/annotations.proto";
|
||||
|
||||
// TelemetryState describes configuration required to forward telemetry to the HashiCorp Cloud Platform.
|
||||
// This resource is managed internally and is only written if the cluster is linked to HCP. Any
|
||||
// manual changes to the resource will be reconciled and overwritten with the internally computed
|
||||
// state.
|
||||
message TelemetryState {
|
||||
option (hashicorp.consul.resource.spec) = {scope: SCOPE_CLUSTER};
|
||||
|
||||
// ResourceId is the identifier for the cluster linked with HCP.
|
||||
string resource_id = 1;
|
||||
|
||||
// ClientId is the oauth client identifier for cluster.
|
||||
// This client has capabilities limited to writing telemetry data for this cluster.
|
||||
string client_id = 2;
|
||||
|
||||
// ClientSecret is the oauth secret used to authenticate requests to send telemetry data to HCP.
|
||||
string client_secret = 3;
|
||||
|
||||
HCPConfig hcp_config = 4;
|
||||
ProxyConfig proxy = 5;
|
||||
MetricsConfig metrics = 6;
|
||||
}
|
||||
|
||||
// MetricsConfig configures metric specific collection details
|
||||
message MetricsConfig {
|
||||
// Endpoint is the HTTPS address and path to forward metrics to
|
||||
string endpoint = 1;
|
||||
|
||||
// IncludeList contains patterns to match against metric names. Only matched metrics are forwarded.
|
||||
repeated string include_list = 2;
|
||||
|
||||
// Labels contains key value pairs that are associated with all metrics collected and fowarded.
|
||||
map<string, string> labels = 3;
|
||||
|
||||
// Disabled toggles metric forwarding. If true, metric forwarding will stop until disabled is set to false.
|
||||
bool disabled = 4;
|
||||
}
|
||||
|
||||
// ProxyConfig describes configuration for forwarding requests through an http proxy
|
||||
message ProxyConfig {
|
||||
// HttpProxy configures the http proxy to use for HTTP (non-TLS) requests.
|
||||
string http_proxy = 1;
|
||||
|
||||
// HttpsProxy configures the http proxy to use for HTTPS (TLS) requests.
|
||||
string https_proxy = 2;
|
||||
|
||||
// NoProxy can be configured to include domains which should NOT be forwarded through the configured http proxy
|
||||
repeated string no_proxy = 3;
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
// Code generated by protoc-gen-deepcopy. DO NOT EDIT.
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// DeepCopyInto supports using TelemetryState within kubernetes types, where deepcopy-gen is used.
|
||||
func (in *TelemetryState) DeepCopyInto(out *TelemetryState) {
|
||||
proto.Reset(out)
|
||||
proto.Merge(out, proto.Clone(in))
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryState. Required by controller-gen.
|
||||
func (in *TelemetryState) DeepCopy() *TelemetryState {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TelemetryState)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryState. Required by controller-gen.
|
||||
func (in *TelemetryState) DeepCopyInterface() interface{} {
|
||||
return in.DeepCopy()
|
||||
}
|
||||
|
||||
// DeepCopyInto supports using MetricsConfig within kubernetes types, where deepcopy-gen is used.
|
||||
func (in *MetricsConfig) DeepCopyInto(out *MetricsConfig) {
|
||||
proto.Reset(out)
|
||||
proto.Merge(out, proto.Clone(in))
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsConfig. Required by controller-gen.
|
||||
func (in *MetricsConfig) DeepCopy() *MetricsConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new MetricsConfig. Required by controller-gen.
|
||||
func (in *MetricsConfig) DeepCopyInterface() interface{} {
|
||||
return in.DeepCopy()
|
||||
}
|
||||
|
||||
// DeepCopyInto supports using ProxyConfig within kubernetes types, where deepcopy-gen is used.
|
||||
func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) {
|
||||
proto.Reset(out)
|
||||
proto.Merge(out, proto.Clone(in))
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig. Required by controller-gen.
|
||||
func (in *ProxyConfig) DeepCopy() *ProxyConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProxyConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig. Required by controller-gen.
|
||||
func (in *ProxyConfig) DeepCopyInterface() interface{} {
|
||||
return in.DeepCopy()
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
// Code generated by protoc-json-shim. DO NOT EDIT.
|
||||
package hcpv2
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
// MarshalJSON is a custom marshaler for TelemetryState
|
||||
func (this *TelemetryState) MarshalJSON() ([]byte, error) {
|
||||
str, err := TelemetryStateMarshaler.Marshal(this)
|
||||
return []byte(str), err
|
||||
}
|
||||
|
||||
// UnmarshalJSON is a custom unmarshaler for TelemetryState
|
||||
func (this *TelemetryState) UnmarshalJSON(b []byte) error {
|
||||
return TelemetryStateUnmarshaler.Unmarshal(b, this)
|
||||
}
|
||||
|
||||
// MarshalJSON is a custom marshaler for MetricsConfig
|
||||
func (this *MetricsConfig) MarshalJSON() ([]byte, error) {
|
||||
str, err := TelemetryStateMarshaler.Marshal(this)
|
||||
return []byte(str), err
|
||||
}
|
||||
|
||||
// UnmarshalJSON is a custom unmarshaler for MetricsConfig
|
||||
func (this *MetricsConfig) UnmarshalJSON(b []byte) error {
|
||||
return TelemetryStateUnmarshaler.Unmarshal(b, this)
|
||||
}
|
||||
|
||||
// MarshalJSON is a custom marshaler for ProxyConfig
|
||||
func (this *ProxyConfig) MarshalJSON() ([]byte, error) {
|
||||
str, err := TelemetryStateMarshaler.Marshal(this)
|
||||
return []byte(str), err
|
||||
}
|
||||
|
||||
// UnmarshalJSON is a custom unmarshaler for ProxyConfig
|
||||
func (this *ProxyConfig) UnmarshalJSON(b []byte) error {
|
||||
return TelemetryStateUnmarshaler.Unmarshal(b, this)
|
||||
}
|
||||
|
||||
var (
|
||||
TelemetryStateMarshaler = &protojson.MarshalOptions{}
|
||||
TelemetryStateUnmarshaler = &protojson.UnmarshalOptions{DiscardUnknown: false}
|
||||
)
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-binary. DO NOT EDIT.
|
||||
// source: pbmulticluster/v2beta1/computed_exported_services.proto
|
||||
// source: pbmulticluster/v2/computed_exported_services.proto
|
||||
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
@ -0,0 +1,367 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: pbmulticluster/v2/computed_exported_services.proto
|
||||
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
pbresource "github.com/hashicorp/consul/proto-public/pbresource"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ComputedExportedServices struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Services []*ComputedExportedService `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServices) Reset() {
|
||||
*x = ComputedExportedServices{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServices) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ComputedExportedServices) ProtoMessage() {}
|
||||
|
||||
func (x *ComputedExportedServices) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ComputedExportedServices.ProtoReflect.Descriptor instead.
|
||||
func (*ComputedExportedServices) Descriptor() ([]byte, []int) {
|
||||
return file_pbmulticluster_v2_computed_exported_services_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServices) GetServices() []*ComputedExportedService {
|
||||
if x != nil {
|
||||
return x.Services
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ComputedExportedService struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TargetRef *pbresource.Reference `protobuf:"bytes,1,opt,name=target_ref,json=targetRef,proto3" json:"target_ref,omitempty"`
|
||||
Consumers []*ComputedExportedServiceConsumer `protobuf:"bytes,2,rep,name=consumers,proto3" json:"consumers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ComputedExportedService) Reset() {
|
||||
*x = ComputedExportedService{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ComputedExportedService) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ComputedExportedService) ProtoMessage() {}
|
||||
|
||||
func (x *ComputedExportedService) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ComputedExportedService.ProtoReflect.Descriptor instead.
|
||||
func (*ComputedExportedService) Descriptor() ([]byte, []int) {
|
||||
return file_pbmulticluster_v2_computed_exported_services_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ComputedExportedService) GetTargetRef() *pbresource.Reference {
|
||||
if x != nil {
|
||||
return x.TargetRef
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ComputedExportedService) GetConsumers() []*ComputedExportedServiceConsumer {
|
||||
if x != nil {
|
||||
return x.Consumers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ComputedExportedServiceConsumer struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// no sameness group
|
||||
//
|
||||
// Types that are assignable to Tenancy:
|
||||
//
|
||||
// *ComputedExportedServiceConsumer_Peer
|
||||
// *ComputedExportedServiceConsumer_Partition
|
||||
Tenancy isComputedExportedServiceConsumer_Tenancy `protobuf_oneof:"tenancy"`
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServiceConsumer) Reset() {
|
||||
*x = ComputedExportedServiceConsumer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServiceConsumer) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ComputedExportedServiceConsumer) ProtoMessage() {}
|
||||
|
||||
func (x *ComputedExportedServiceConsumer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ComputedExportedServiceConsumer.ProtoReflect.Descriptor instead.
|
||||
func (*ComputedExportedServiceConsumer) Descriptor() ([]byte, []int) {
|
||||
return file_pbmulticluster_v2_computed_exported_services_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (m *ComputedExportedServiceConsumer) GetTenancy() isComputedExportedServiceConsumer_Tenancy {
|
||||
if m != nil {
|
||||
return m.Tenancy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServiceConsumer) GetPeer() string {
|
||||
if x, ok := x.GetTenancy().(*ComputedExportedServiceConsumer_Peer); ok {
|
||||
return x.Peer
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ComputedExportedServiceConsumer) GetPartition() string {
|
||||
if x, ok := x.GetTenancy().(*ComputedExportedServiceConsumer_Partition); ok {
|
||||
return x.Partition
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isComputedExportedServiceConsumer_Tenancy interface {
|
||||
isComputedExportedServiceConsumer_Tenancy()
|
||||
}
|
||||
|
||||
type ComputedExportedServiceConsumer_Peer struct {
|
||||
Peer string `protobuf:"bytes,3,opt,name=peer,proto3,oneof"`
|
||||
}
|
||||
|
||||
type ComputedExportedServiceConsumer_Partition struct {
|
||||
Partition string `protobuf:"bytes,4,opt,name=partition,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*ComputedExportedServiceConsumer_Peer) isComputedExportedServiceConsumer_Tenancy() {}
|
||||
|
||||
func (*ComputedExportedServiceConsumer_Partition) isComputedExportedServiceConsumer_Tenancy() {}
|
||||
|
||||
var File_pbmulticluster_v2_computed_exported_services_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pbmulticluster_v2_computed_exported_services_proto_rawDesc = []byte{
|
||||
0x0a, 0x32, 0x70, 0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x79, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x08, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e,
|
||||
0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c,
|
||||
0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65,
|
||||
0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x3a, 0x06, 0xa2, 0x93, 0x04, 0x02, 0x08, 0x02, 0x22, 0xbf, 0x01, 0x0a, 0x17, 0x43,
|
||||
0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
|
||||
0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x66, 0x12, 0x5f, 0x0a, 0x09, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41,
|
||||
0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75,
|
||||
0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,
|
||||
0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
|
||||
0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x22, 0x62, 0x0a, 0x1f,
|
||||
0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x12,
|
||||
0x14, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
|
||||
0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74,
|
||||
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79,
|
||||
0x42, 0xb3, 0x02, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
|
||||
0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63,
|
||||
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x42, 0x1d, 0x43, 0x6f, 0x6d, 0x70, 0x75,
|
||||
0x74, 0x65, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70,
|
||||
0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75,
|
||||
0x62, 0x6c, 0x69, 0x63, 0x2f, 0x70, 0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x3b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x48, 0x43, 0x4d, 0xaa, 0x02, 0x20, 0x48, 0x61,
|
||||
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x4d,
|
||||
0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x32, 0xca, 0x02,
|
||||
0x20, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75,
|
||||
0x6c, 0x5c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5c, 0x56,
|
||||
0x32, 0xe2, 0x02, 0x2c, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f,
|
||||
0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65,
|
||||
0x72, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||
0xea, 0x02, 0x23, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x3a, 0x3a, 0x43, 0x6f,
|
||||
0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74,
|
||||
0x65, 0x72, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_rawDescOnce sync.Once
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_rawDescData = file_pbmulticluster_v2_computed_exported_services_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pbmulticluster_v2_computed_exported_services_proto_rawDescGZIP() []byte {
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_rawDescOnce.Do(func() {
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbmulticluster_v2_computed_exported_services_proto_rawDescData)
|
||||
})
|
||||
return file_pbmulticluster_v2_computed_exported_services_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pbmulticluster_v2_computed_exported_services_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_pbmulticluster_v2_computed_exported_services_proto_goTypes = []interface{}{
|
||||
(*ComputedExportedServices)(nil), // 0: hashicorp.consul.multicluster.v2.ComputedExportedServices
|
||||
(*ComputedExportedService)(nil), // 1: hashicorp.consul.multicluster.v2.ComputedExportedService
|
||||
(*ComputedExportedServiceConsumer)(nil), // 2: hashicorp.consul.multicluster.v2.ComputedExportedServiceConsumer
|
||||
(*pbresource.Reference)(nil), // 3: hashicorp.consul.resource.Reference
|
||||
}
|
||||
var file_pbmulticluster_v2_computed_exported_services_proto_depIdxs = []int32{
|
||||
1, // 0: hashicorp.consul.multicluster.v2.ComputedExportedServices.services:type_name -> hashicorp.consul.multicluster.v2.ComputedExportedService
|
||||
3, // 1: hashicorp.consul.multicluster.v2.ComputedExportedService.target_ref:type_name -> hashicorp.consul.resource.Reference
|
||||
2, // 2: hashicorp.consul.multicluster.v2.ComputedExportedService.consumers:type_name -> hashicorp.consul.multicluster.v2.ComputedExportedServiceConsumer
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pbmulticluster_v2_computed_exported_services_proto_init() }
|
||||
func file_pbmulticluster_v2_computed_exported_services_proto_init() {
|
||||
if File_pbmulticluster_v2_computed_exported_services_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ComputedExportedServices); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ComputedExportedService); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ComputedExportedServiceConsumer); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_msgTypes[2].OneofWrappers = []interface{}{
|
||||
(*ComputedExportedServiceConsumer_Peer)(nil),
|
||||
(*ComputedExportedServiceConsumer_Partition)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pbmulticluster_v2_computed_exported_services_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_pbmulticluster_v2_computed_exported_services_proto_goTypes,
|
||||
DependencyIndexes: file_pbmulticluster_v2_computed_exported_services_proto_depIdxs,
|
||||
MessageInfos: file_pbmulticluster_v2_computed_exported_services_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pbmulticluster_v2_computed_exported_services_proto = out.File
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_rawDesc = nil
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_goTypes = nil
|
||||
file_pbmulticluster_v2_computed_exported_services_proto_depIdxs = nil
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-deepcopy. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
proto "google.golang.org/protobuf/proto"
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-json-shim. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-binary. DO NOT EDIT.
|
||||
// source: pbmulticluster/v2beta1/exported_services.proto
|
||||
// source: pbmulticluster/v2/exported_services.proto
|
||||
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
@ -0,0 +1,190 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: pbmulticluster/v2/exported_services.proto
|
||||
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
_ "github.com/hashicorp/consul/proto-public/pbresource"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ExportedServices struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
|
||||
Consumers []*ExportedServicesConsumer `protobuf:"bytes,2,rep,name=consumers,proto3" json:"consumers,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExportedServices) Reset() {
|
||||
*x = ExportedServices{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbmulticluster_v2_exported_services_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExportedServices) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExportedServices) ProtoMessage() {}
|
||||
|
||||
func (x *ExportedServices) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbmulticluster_v2_exported_services_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExportedServices.ProtoReflect.Descriptor instead.
|
||||
func (*ExportedServices) Descriptor() ([]byte, []int) {
|
||||
return file_pbmulticluster_v2_exported_services_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ExportedServices) GetServices() []string {
|
||||
if x != nil {
|
||||
return x.Services
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExportedServices) GetConsumers() []*ExportedServicesConsumer {
|
||||
if x != nil {
|
||||
return x.Consumers
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_pbmulticluster_v2_exported_services_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pbmulticluster_v2_exported_services_proto_rawDesc = []byte{
|
||||
0x0a, 0x29, 0x70, 0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75,
|
||||
0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x1a, 0x32, 0x70,
|
||||
0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x32,
|
||||
0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x1c, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x90, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
|
||||
0x12, 0x58, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x52,
|
||||
0x09, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x3a, 0x06, 0xa2, 0x93, 0x04, 0x02,
|
||||
0x08, 0x03, 0x42, 0xab, 0x02, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69,
|
||||
0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74,
|
||||
0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x42, 0x15, 0x45, 0x78, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x75,
|
||||
0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x70,
|
||||
0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x32,
|
||||
0x3b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x76, 0x32, 0xa2,
|
||||
0x02, 0x03, 0x48, 0x43, 0x4d, 0xaa, 0x02, 0x20, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
|
||||
0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c,
|
||||
0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x20, 0x48, 0x61, 0x73, 0x68, 0x69,
|
||||
0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x4d, 0x75, 0x6c, 0x74,
|
||||
0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x2c, 0x48, 0x61,
|
||||
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x4d,
|
||||
0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x32, 0x5c, 0x47,
|
||||
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x23, 0x48, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a,
|
||||
0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x32,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pbmulticluster_v2_exported_services_proto_rawDescOnce sync.Once
|
||||
file_pbmulticluster_v2_exported_services_proto_rawDescData = file_pbmulticluster_v2_exported_services_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pbmulticluster_v2_exported_services_proto_rawDescGZIP() []byte {
|
||||
file_pbmulticluster_v2_exported_services_proto_rawDescOnce.Do(func() {
|
||||
file_pbmulticluster_v2_exported_services_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbmulticluster_v2_exported_services_proto_rawDescData)
|
||||
})
|
||||
return file_pbmulticluster_v2_exported_services_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pbmulticluster_v2_exported_services_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_pbmulticluster_v2_exported_services_proto_goTypes = []interface{}{
|
||||
(*ExportedServices)(nil), // 0: hashicorp.consul.multicluster.v2.ExportedServices
|
||||
(*ExportedServicesConsumer)(nil), // 1: hashicorp.consul.multicluster.v2.ExportedServicesConsumer
|
||||
}
|
||||
var file_pbmulticluster_v2_exported_services_proto_depIdxs = []int32{
|
||||
1, // 0: hashicorp.consul.multicluster.v2.ExportedServices.consumers:type_name -> hashicorp.consul.multicluster.v2.ExportedServicesConsumer
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pbmulticluster_v2_exported_services_proto_init() }
|
||||
func file_pbmulticluster_v2_exported_services_proto_init() {
|
||||
if File_pbmulticluster_v2_exported_services_proto != nil {
|
||||
return
|
||||
}
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pbmulticluster_v2_exported_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ExportedServices); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pbmulticluster_v2_exported_services_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_pbmulticluster_v2_exported_services_proto_goTypes,
|
||||
DependencyIndexes: file_pbmulticluster_v2_exported_services_proto_depIdxs,
|
||||
MessageInfos: file_pbmulticluster_v2_exported_services_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pbmulticluster_v2_exported_services_proto = out.File
|
||||
file_pbmulticluster_v2_exported_services_proto_rawDesc = nil
|
||||
file_pbmulticluster_v2_exported_services_proto_goTypes = nil
|
||||
file_pbmulticluster_v2_exported_services_proto_depIdxs = nil
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-binary. DO NOT EDIT.
|
||||
// source: pbmulticluster/v2beta1/exported_services_consumer.proto
|
||||
// source: pbmulticluster/v2/exported_services_consumer.proto
|
||||
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
@ -0,0 +1,230 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: pbmulticluster/v2/exported_services_consumer.proto
|
||||
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// +kubebuilder:validation:Type=object
|
||||
// +kubebuilder:validation:Schemaless
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
type ExportedServicesConsumer struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to ConsumerTenancy:
|
||||
//
|
||||
// *ExportedServicesConsumer_Peer
|
||||
// *ExportedServicesConsumer_Partition
|
||||
// *ExportedServicesConsumer_SamenessGroup
|
||||
ConsumerTenancy isExportedServicesConsumer_ConsumerTenancy `protobuf_oneof:"consumer_tenancy"`
|
||||
}
|
||||
|
||||
func (x *ExportedServicesConsumer) Reset() {
|
||||
*x = ExportedServicesConsumer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExportedServicesConsumer) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExportedServicesConsumer) ProtoMessage() {}
|
||||
|
||||
func (x *ExportedServicesConsumer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExportedServicesConsumer.ProtoReflect.Descriptor instead.
|
||||
func (*ExportedServicesConsumer) Descriptor() ([]byte, []int) {
|
||||
return file_pbmulticluster_v2_exported_services_consumer_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *ExportedServicesConsumer) GetConsumerTenancy() isExportedServicesConsumer_ConsumerTenancy {
|
||||
if m != nil {
|
||||
return m.ConsumerTenancy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExportedServicesConsumer) GetPeer() string {
|
||||
if x, ok := x.GetConsumerTenancy().(*ExportedServicesConsumer_Peer); ok {
|
||||
return x.Peer
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExportedServicesConsumer) GetPartition() string {
|
||||
if x, ok := x.GetConsumerTenancy().(*ExportedServicesConsumer_Partition); ok {
|
||||
return x.Partition
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExportedServicesConsumer) GetSamenessGroup() string {
|
||||
if x, ok := x.GetConsumerTenancy().(*ExportedServicesConsumer_SamenessGroup); ok {
|
||||
return x.SamenessGroup
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isExportedServicesConsumer_ConsumerTenancy interface {
|
||||
isExportedServicesConsumer_ConsumerTenancy()
|
||||
}
|
||||
|
||||
type ExportedServicesConsumer_Peer struct {
|
||||
Peer string `protobuf:"bytes,1,opt,name=peer,proto3,oneof"`
|
||||
}
|
||||
|
||||
type ExportedServicesConsumer_Partition struct {
|
||||
Partition string `protobuf:"bytes,2,opt,name=partition,proto3,oneof"`
|
||||
}
|
||||
|
||||
type ExportedServicesConsumer_SamenessGroup struct {
|
||||
SamenessGroup string `protobuf:"bytes,3,opt,name=sameness_group,json=samenessGroup,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*ExportedServicesConsumer_Peer) isExportedServicesConsumer_ConsumerTenancy() {}
|
||||
|
||||
func (*ExportedServicesConsumer_Partition) isExportedServicesConsumer_ConsumerTenancy() {}
|
||||
|
||||
func (*ExportedServicesConsumer_SamenessGroup) isExportedServicesConsumer_ConsumerTenancy() {}
|
||||
|
||||
var File_pbmulticluster_v2_exported_services_consumer_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pbmulticluster_v2_exported_services_consumer_proto_rawDesc = []byte{
|
||||
0x0a, 0x32, 0x70, 0x62, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73,
|
||||
0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x22, 0x8d, 0x01, 0x0a, 0x18, 0x45, 0x78, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75,
|
||||
0x6d, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x48, 0x00, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x09, 0x70, 0x61, 0x72,
|
||||
0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09,
|
||||
0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x61, 0x6d,
|
||||
0x65, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x61, 0x6d, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f,
|
||||
0x75, 0x70, 0x42, 0x12, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x5f, 0x74,
|
||||
0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x42, 0xb3, 0x02, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x68,
|
||||
0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e,
|
||||
0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x42,
|
||||
0x1d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x70, 0x62, 0x6d, 0x75, 0x6c,
|
||||
0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x3b, 0x6d, 0x75, 0x6c,
|
||||
0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x48, 0x43,
|
||||
0x4d, 0xaa, 0x02, 0x20, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x43, 0x6f,
|
||||
0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65,
|
||||
0x72, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x20, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70,
|
||||
0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x6c, 0x75,
|
||||
0x73, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x2c, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63,
|
||||
0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x4d, 0x75, 0x6c, 0x74, 0x69,
|
||||
0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x23, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
|
||||
0x72, 0x70, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x4d, 0x75, 0x6c, 0x74,
|
||||
0x69, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_rawDescOnce sync.Once
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_rawDescData = file_pbmulticluster_v2_exported_services_consumer_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pbmulticluster_v2_exported_services_consumer_proto_rawDescGZIP() []byte {
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_rawDescOnce.Do(func() {
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbmulticluster_v2_exported_services_consumer_proto_rawDescData)
|
||||
})
|
||||
return file_pbmulticluster_v2_exported_services_consumer_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_pbmulticluster_v2_exported_services_consumer_proto_goTypes = []interface{}{
|
||||
(*ExportedServicesConsumer)(nil), // 0: hashicorp.consul.multicluster.v2.ExportedServicesConsumer
|
||||
}
|
||||
var file_pbmulticluster_v2_exported_services_consumer_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pbmulticluster_v2_exported_services_consumer_proto_init() }
|
||||
func file_pbmulticluster_v2_exported_services_consumer_proto_init() {
|
||||
if File_pbmulticluster_v2_exported_services_consumer_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ExportedServicesConsumer); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*ExportedServicesConsumer_Peer)(nil),
|
||||
(*ExportedServicesConsumer_Partition)(nil),
|
||||
(*ExportedServicesConsumer_SamenessGroup)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pbmulticluster_v2_exported_services_consumer_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_pbmulticluster_v2_exported_services_consumer_proto_goTypes,
|
||||
DependencyIndexes: file_pbmulticluster_v2_exported_services_consumer_proto_depIdxs,
|
||||
MessageInfos: file_pbmulticluster_v2_exported_services_consumer_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pbmulticluster_v2_exported_services_consumer_proto = out.File
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_rawDesc = nil
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_goTypes = nil
|
||||
file_pbmulticluster_v2_exported_services_consumer_proto_depIdxs = nil
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-deepcopy. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
proto "google.golang.org/protobuf/proto"
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-json-shim. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-deepcopy. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
proto "google.golang.org/protobuf/proto"
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-json-shim. DO NOT EDIT.
|
||||
package multiclusterv2beta1
|
||||
package multiclusterv2
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue