Skip to content

Commit

Permalink
Net 6821 - Regenerate Terminating Gateway CRD with new field (#3737)
Browse files Browse the repository at this point in the history
* initial updates

* regen crds
  • Loading branch information
sarahalsmiller authored Mar 19, 2024
1 parent 2780dc2 commit 85847ca
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
4 changes: 4 additions & 0 deletions charts/consul/templates/crd-terminatinggateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
to use for TLS connections from the gateway to the linked
service.
type: string
disableAutoHostRewrite:
description: DisableAutoHostRewrite disables terminating gateways
auto host rewrite feature when set to true.
type: boolean
keyFile:
description: KeyFile is the optional path to a private key to
use for TLS connections from the gateway to the linked service.
Expand Down
16 changes: 10 additions & 6 deletions control-plane/api/v1alpha1/terminatinggateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ type LinkedService struct {

// SNI is the optional name to specify during the TLS handshake with a linked service.
SNI string `json:"sni,omitempty"`

//DisableAutoHostRewrite disables terminating gateways auto host rewrite feature when set to true.
DisableAutoHostRewrite bool `json:"disableAutoHostRewrite,omitempty"`
}

func (in *TerminatingGateway) GetObjectMeta() metav1.ObjectMeta {
Expand Down Expand Up @@ -218,12 +221,13 @@ func (in *TerminatingGateway) DefaultNamespaceFields(consulMeta common.ConsulMet

func (in LinkedService) toConsul() capi.LinkedService {
return capi.LinkedService{
Namespace: in.Namespace,
Name: in.Name,
CAFile: in.CAFile,
CertFile: in.CertFile,
KeyFile: in.KeyFile,
SNI: in.SNI,
Namespace: in.Namespace,
Name: in.Name,
CAFile: in.CAFile,
CertFile: in.CertFile,
KeyFile: in.KeyFile,
SNI: in.SNI,
DisableAutoHostRewrite: in.DisableAutoHostRewrite,
}
}

Expand Down
22 changes: 12 additions & 10 deletions control-plane/api/v1alpha1/terminatinggateway_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ func TestTerminatingGateway_MatchesConsul(t *testing.T) {
Spec: TerminatingGatewaySpec{
Services: []LinkedService{
{
Name: "name",
CAFile: "caFile",
CertFile: "certFile",
KeyFile: "keyFile",
SNI: "sni",
Name: "name",
CAFile: "caFile",
CertFile: "certFile",
KeyFile: "keyFile",
SNI: "sni",
DisableAutoHostRewrite: true,
},
{
Name: "*",
Expand All @@ -71,11 +72,12 @@ func TestTerminatingGateway_MatchesConsul(t *testing.T) {
},
Services: []capi.LinkedService{
{
Name: "name",
CAFile: "caFile",
CertFile: "certFile",
KeyFile: "keyFile",
SNI: "sni",
Name: "name",
CAFile: "caFile",
CertFile: "certFile",
KeyFile: "keyFile",
SNI: "sni",
DisableAutoHostRewrite: true,
},
{
Name: "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ spec:
to use for TLS connections from the gateway to the linked
service.
type: string
disableAutoHostRewrite:
description: DisableAutoHostRewrite disables terminating gateways
auto host rewrite feature when set to true.
type: boolean
keyFile:
description: KeyFile is the optional path to a private key to
use for TLS connections from the gateway to the linked service.
Expand Down
2 changes: 2 additions & 0 deletions control-plane/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/hashicorp/consul-k8s/control-plane

replace github.com/hashicorp/consul/api => github.com/hashicorp/consul/api v1.10.1-0.20240312203720-262f4358003f

require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/containernetworking/cni v1.1.2
Expand Down
4 changes: 2 additions & 2 deletions control-plane/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ github.com/hashicorp/consul-k8s/control-plane/cni v0.0.0-20240226161840-f3842c41
github.com/hashicorp/consul-k8s/control-plane/cni v0.0.0-20240226161840-f3842c41cb2b/go.mod h1:9NKJHOcgmz/6P2y6MegNIOXhIKE/0ils/mHWd5sZgoU=
github.com/hashicorp/consul-server-connection-manager v0.1.6 h1:ktj8Fi+dRXn9hhM+FXsfEJayhzzgTqfH08Ne5M6Fmug=
github.com/hashicorp/consul-server-connection-manager v0.1.6/go.mod h1:HngMIv57MT+pqCVeRQMa1eTB5dqnyMm8uxjyv+Hn8cs=
github.com/hashicorp/consul/api v1.28.2 h1:mXfkRHrpHN4YY3RqL09nXU1eHKLNiuAN4kHvDQ16k/8=
github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE=
github.com/hashicorp/consul/api v1.10.1-0.20240312203720-262f4358003f h1:8clIrMnJtO5ab5Kd1qF19s9s581cyGYhQxfPLVRaFZs=
github.com/hashicorp/consul/api v1.10.1-0.20240312203720-262f4358003f/go.mod h1:JnWx0qZd1Ffeoa42yVAxzv7/v7eaZyptkw0dG9F/gF4=
github.com/hashicorp/consul/proto-public v0.6.0 h1:9qrBujmoTB5gQQ84kQO+YWvhjgYoYBNrOoHdo4cpHHM=
github.com/hashicorp/consul/proto-public v0.6.0/go.mod h1:JF6983XNCzvw4wDNOLEwLqOq2IPw7iyT+pkswHSz08U=
github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8=
Expand Down

0 comments on commit 85847ca

Please sign in to comment.