Skip to content

Commit

Permalink
NET-7179: Update MeshGateway to use new proto with workload selector (#…
Browse files Browse the repository at this point in the history
…3465)

* NET-7179: Update MeshGateway to use new proto with workload selector

* fix import

* Update control-plane/api/mesh/v2beta1/mesh_gateway_types.go

Co-authored-by: Nathan Coleman <[email protected]>

* remove worload override

* fix imports

---------

Co-authored-by: Nathan Coleman <[email protected]>
  • Loading branch information
NiniOak and nathancoleman authored Jan 18, 2024
1 parent 5d9bd49 commit 602ffde
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
14 changes: 14 additions & 0 deletions charts/consul/templates/crd-meshgateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions charts/consul/templates/gateway-resources-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@ data:
- name: "wan"
port: {{ .Values.meshGateway.service.port }}
protocol: "TCP"
workloads:
prefixes:
- "mesh-gateway"
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions control-plane/gateways/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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----- │
Expand Down
2 changes: 1 addition & 1 deletion control-plane/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions control-plane/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 1 addition & 2 deletions control-plane/subcommand/gateway-resources/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 602ffde

Please sign in to comment.