diff --git a/charts/consul/templates/crd-meshgateways.yaml b/charts/consul/templates/crd-meshgateways.yaml index a7ebc1836d..6202add695 100644 --- a/charts/consul/templates/crd-meshgateways.yaml +++ b/charts/consul/templates/crd-meshgateways.yaml @@ -73,6 +73,20 @@ spec: type: object minItems: 1 type: array + workloads: + description: Selection of workloads to be configured as mesh gateways + properties: + filter: + type: string + names: + items: + type: string + type: array + prefixes: + items: + type: string + type: array + type: object type: object status: properties: diff --git a/charts/consul/templates/gateway-resources-configmap.yaml b/charts/consul/templates/gateway-resources-configmap.yaml index 2cf7ae86d0..842ba6690d 100644 --- a/charts/consul/templates/gateway-resources-configmap.yaml +++ b/charts/consul/templates/gateway-resources-configmap.yaml @@ -125,5 +125,8 @@ data: - name: "wan" port: {{ .Values.meshGateway.service.port }} protocol: "TCP" + workloads: + prefixes: + - "mesh-gateway" {{- end }} {{- end }} diff --git a/control-plane/config/crd/bases/mesh.consul.hashicorp.com_meshgateways.yaml b/control-plane/config/crd/bases/mesh.consul.hashicorp.com_meshgateways.yaml index 2e5ea1596f..47f2fcfba8 100644 --- a/control-plane/config/crd/bases/mesh.consul.hashicorp.com_meshgateways.yaml +++ b/control-plane/config/crd/bases/mesh.consul.hashicorp.com_meshgateways.yaml @@ -69,6 +69,20 @@ spec: type: object minItems: 1 type: array + workloads: + description: Selection of workloads to be configured as mesh gateways + properties: + filter: + type: string + names: + items: + type: string + type: array + prefixes: + items: + type: string + type: array + type: object type: object status: properties: diff --git a/control-plane/gateways/deployment_test.go b/control-plane/gateways/deployment_test.go index 37fcb80c59..66b834a951 100644 --- a/control-plane/gateways/deployment_test.go +++ b/control-plane/gateways/deployment_test.go @@ -14,10 +14,9 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/pointer" - pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" - meshv2beta1 "github.com/hashicorp/consul-k8s/control-plane/api/mesh/v2beta1" "github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants" + pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" ) const testCert = `-----BEGIN CERTIFICATE----- │ diff --git a/control-plane/go.mod b/control-plane/go.mod index 2e9c55afdb..ac4e18079b 100644 --- a/control-plane/go.mod +++ b/control-plane/go.mod @@ -2,7 +2,7 @@ module github.com/hashicorp/consul-k8s/control-plane // TODO: Remove this when the next version of the submodule is released. // We need to use a replace directive instead of directly pinning because `api` requires version `0.5.1` and will clobber the pin, but not the replace directive. -replace github.com/hashicorp/consul/proto-public => github.com/hashicorp/consul/proto-public v0.1.2-0.20240111191232-1e351e286e08 +replace github.com/hashicorp/consul/proto-public => github.com/hashicorp/consul/proto-public v0.1.2-0.20240116214818-6a8554317502 replace github.com/hashicorp/consul/sdk => github.com/hashicorp/consul/sdk v0.4.1-0.20231213150639-123bc95e1a3f diff --git a/control-plane/go.sum b/control-plane/go.sum index debfd13a28..835183b4c2 100644 --- a/control-plane/go.sum +++ b/control-plane/go.sum @@ -265,8 +265,8 @@ github.com/hashicorp/consul-server-connection-manager v0.1.6 h1:ktj8Fi+dRXn9hhM+ github.com/hashicorp/consul-server-connection-manager v0.1.6/go.mod h1:HngMIv57MT+pqCVeRQMa1eTB5dqnyMm8uxjyv+Hn8cs= github.com/hashicorp/consul/api v1.26.1 h1:5oSXOO5fboPZeW5SN+TdGFP/BILDgBm19OrPZ/pICIM= github.com/hashicorp/consul/api v1.26.1/go.mod h1:B4sQTeaSO16NtynqrAdwOlahJ7IUDZM9cj2420xYL8A= -github.com/hashicorp/consul/proto-public v0.1.2-0.20240111191232-1e351e286e08 h1:oYbCbKfscW83pWuI/BkVajKH93qCJ1tPzZzGAmj5Ivo= -github.com/hashicorp/consul/proto-public v0.1.2-0.20240111191232-1e351e286e08/go.mod h1:ar/M/Gv31GeE7DxektZgAydwsCiOf6sBeJFcjQVTlVs= +github.com/hashicorp/consul/proto-public v0.1.2-0.20240116214818-6a8554317502 h1:DeUPf9K/hAXVY6bTheu1mDsszkOzB3Dgz3hLVSUp8GA= +github.com/hashicorp/consul/proto-public v0.1.2-0.20240116214818-6a8554317502/go.mod h1:ar/M/Gv31GeE7DxektZgAydwsCiOf6sBeJFcjQVTlVs= github.com/hashicorp/consul/sdk v0.4.1-0.20231213150639-123bc95e1a3f h1:GKsa7bfoL7xgvCkzYJMF9eYYNfLWQyk8QuRZZl4nMTo= github.com/hashicorp/consul/sdk v0.4.1-0.20231213150639-123bc95e1a3f/go.mod h1:r/OmRRPbHOe0yxNahLw7G9x5WG17E1BIECMtCjcPSNo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/control-plane/subcommand/gateway-resources/command_test.go b/control-plane/subcommand/gateway-resources/command_test.go index 4d88e5fc13..5fbba60230 100644 --- a/control-plane/subcommand/gateway-resources/command_test.go +++ b/control-plane/subcommand/gateway-resources/command_test.go @@ -17,10 +17,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" - meshv2beta1 "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" - "github.com/hashicorp/consul-k8s/control-plane/api/mesh/v2beta1" "github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1" + meshv2beta1 "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" ) func TestRun_flagValidation(t *testing.T) {