Skip to content

Commit

Permalink
reconcile consul-k8s with changes made in Consul (#3543)
Browse files Browse the repository at this point in the history
NiniOak authored and nathancoleman committed Feb 7, 2024

Verified

This commit was signed with the committer’s verified signature.
rouault Even Rouault
1 parent 94d7eec commit 258fe4d
Showing 34 changed files with 41 additions and 282 deletions.
7 changes: 0 additions & 7 deletions charts/consul/templates/crd-apigateways.yaml
Original file line number Diff line number Diff line change
@@ -114,13 +114,6 @@ spec:
provide the wildcard value \"*\" to list resources
across all partitions."
type: string
peerName:
description: "PeerName identifies which peer the
resource is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints,
provide the wildcard value \"*\" to list resources
across all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-grpcroutes.yaml
Original file line number Diff line number Diff line change
@@ -72,9 +72,10 @@ spec:
description: 'NOTE: roughly equivalent to structs.ResourceReference'
properties:
port:
description: For east/west this is the name of the Consul Service
description: "For east/west this is the name of the Consul Service
port to direct traffic to or empty to imply all. For north/south
this is TBD.
this is TBD. \n For more details on potential values of this
field, see documentation for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should point
@@ -106,13 +107,6 @@ spec:
the wildcard value \"*\" to list resources across
all partitions."
type: string
peerName:
description: "PeerName identifies which peer the resource
is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints, provide
the wildcard value \"*\" to list resources across
all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
@@ -166,7 +160,9 @@ spec:
description: "For east/west this is the name of the
Consul Service port to direct traffic to or empty
to imply using the same value as the parent ref.
\n For north/south this is TBD."
For north/south this is TBD. \n For more details
on potential values of this field, see documentation
for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should
@@ -199,13 +195,6 @@ spec:
provide the wildcard value \"*\" to list
resources across all partitions."
type: string
peerName:
description: "PeerName identifies which peer
the resource is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints,
provide the wildcard value \"*\" to list
resources across all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-httproutes.yaml
Original file line number Diff line number Diff line change
@@ -72,9 +72,10 @@ spec:
description: 'NOTE: roughly equivalent to structs.ResourceReference'
properties:
port:
description: For east/west this is the name of the Consul Service
description: "For east/west this is the name of the Consul Service
port to direct traffic to or empty to imply all. For north/south
this is TBD.
this is TBD. \n For more details on potential values of this
field, see documentation for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should point
@@ -106,13 +107,6 @@ spec:
the wildcard value \"*\" to list resources across
all partitions."
type: string
peerName:
description: "PeerName identifies which peer the resource
is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints, provide
the wildcard value \"*\" to list resources across
all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
@@ -169,7 +163,9 @@ spec:
description: "For east/west this is the name of the
Consul Service port to direct traffic to or empty
to imply using the same value as the parent ref.
\n For north/south this is TBD."
For north/south this is TBD. \n For more details
on potential values of this field, see documentation
for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should
@@ -202,13 +198,6 @@ spec:
provide the wildcard value \"*\" to list
resources across all partitions."
type: string
peerName:
description: "PeerName identifies which peer
the resource is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints,
provide the wildcard value \"*\" to list
resources across all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-tcproutes.yaml
Original file line number Diff line number Diff line change
@@ -66,9 +66,10 @@ spec:
description: 'NOTE: roughly equivalent to structs.ResourceReference'
properties:
port:
description: For east/west this is the name of the Consul Service
description: "For east/west this is the name of the Consul Service
port to direct traffic to or empty to imply all. For north/south
this is TBD.
this is TBD. \n For more details on potential values of this
field, see documentation for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should point
@@ -100,13 +101,6 @@ spec:
the wildcard value \"*\" to list resources across
all partitions."
type: string
peerName:
description: "PeerName identifies which peer the resource
is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints, provide
the wildcard value \"*\" to list resources across
all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
@@ -151,7 +145,9 @@ spec:
description: "For east/west this is the name of the
Consul Service port to direct traffic to or empty
to imply using the same value as the parent ref.
\n For north/south this is TBD."
For north/south this is TBD. \n For more details
on potential values of this field, see documentation
for Service.ServicePort."
type: string
ref:
description: For east/west configuration, this should
@@ -184,13 +180,6 @@ spec:
provide the wildcard value \"*\" to list
resources across all partitions."
type: string
peerName:
description: "PeerName identifies which peer
the resource is imported from. https://developer.hashicorp.com/consul/docs/connect/cluster-peering
\n When using the List and WatchList endpoints,
provide the wildcard value \"*\" to list
resources across all peers."
type: string
type: object
type:
description: Type identifies the resource's type.
5 changes: 0 additions & 5 deletions control-plane/api/auth/v2beta1/traffic_permissions_types.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -62,10 +61,6 @@ func (in *TrafficPermissions) ResourceID(namespace, partition string) *pbresourc
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
Original file line number Diff line number Diff line change
@@ -317,10 +317,6 @@ func TestTrafficPermissions_MatchesConsul(t *testing.T) {
Tenancy: &pbresource.Tenancy{
Partition: constants.DefaultConsulNS,
Namespace: constants.DefaultConsulPartition,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
},
Data: inject.ToProtoAny(&pbmesh.ProxyConfiguration{}),
@@ -1021,10 +1017,6 @@ func constructTrafficPermissionResource(tp *pbauth.TrafficPermissions, name, nam
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
Uid: "ABCD", // We add this to show it does not factor into the comparison
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/api_gateway_types.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -58,10 +57,6 @@ func (in *APIGateway) ResourceID(namespace, partition string) *pbresource.ID {
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/grpc_route_types.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -61,10 +60,6 @@ func (in *GRPCRoute) ResourceID(namespace, partition string) *pbresource.ID {
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
8 changes: 0 additions & 8 deletions control-plane/api/mesh/v2beta1/grpc_route_types_test.go
Original file line number Diff line number Diff line change
@@ -277,10 +277,6 @@ func TestGRPCRoute_MatchesConsul(t *testing.T) {
Tenancy: &pbresource.Tenancy{
Partition: constants.DefaultConsulNS,
Namespace: constants.DefaultConsulPartition,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
},
Data: inject.ToProtoAny(&pbmesh.ProxyConfiguration{}),
@@ -1174,10 +1170,6 @@ func constructGRPCRouteResource(tp *pbmesh.GRPCRoute, name, namespace, partition
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
Uid: "ABCD", // We add this to show it does not factor into the comparison
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/http_route_types.go
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -63,10 +62,6 @@ func (in *HTTPRoute) ResourceID(namespace, partition string) *pbresource.ID {
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
8 changes: 0 additions & 8 deletions control-plane/api/mesh/v2beta1/http_route_types_test.go
Original file line number Diff line number Diff line change
@@ -435,10 +435,6 @@ func TestHTTPRoute_MatchesConsul(t *testing.T) {
Tenancy: &pbresource.Tenancy{
Partition: constants.DefaultConsulNS,
Namespace: constants.DefaultConsulPartition,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
},
Data: inject.ToProtoAny(&pbmesh.ProxyConfiguration{}),
@@ -1311,10 +1307,6 @@ func constructHTTPRouteResource(tp *pbmesh.HTTPRoute, name, namespace, partition
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
Uid: "ABCD", // We add this to show it does not factor into the comparison
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/mesh_configuration_types.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
"github.com/hashicorp/consul/proto-public/pbresource"
"google.golang.org/protobuf/testing/protocmp"
@@ -57,10 +56,6 @@ func (in *MeshConfiguration) ResourceID(_, partition string) *pbresource.ID {
Tenancy: &pbresource.Tenancy{
// we don't pass a namespace here because MeshConfiguration is partition-scoped
Partition: partition,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/mesh_gateway_types.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -58,10 +57,6 @@ func (in *MeshGateway) ResourceID(_, partition string) *pbresource.ID {
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: "", // Namespace is always unset because MeshGateway is partition-scoped

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/proxy_configuration_types.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import (

"github.com/hashicorp/consul-k8s/control-plane/api/common"
inject "github.com/hashicorp/consul-k8s/control-plane/connect-inject/common"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
)

const (
@@ -61,10 +60,6 @@ func (in *ProxyConfiguration) ResourceID(namespace, partition string) *pbresourc
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
}
}
Original file line number Diff line number Diff line change
@@ -220,10 +220,6 @@ func TestProxyConfiguration_MatchesConsul(t *testing.T) {
Tenancy: &pbresource.Tenancy{
Partition: constants.DefaultConsulNS,
Namespace: constants.DefaultConsulPartition,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
},
Data: inject.ToProtoAny(&pbmesh.ProxyConfiguration{}),
@@ -524,10 +520,6 @@ func constructProxyConfigurationResource(tp *pbmesh.ProxyConfiguration, name, na
Tenancy: &pbresource.Tenancy{
Partition: partition,
Namespace: namespace,

// Because we are explicitly defining NS/partition, this will not default and must be explicit.
// At a future point, this will move out of the Tenancy block.
PeerName: constants.DefaultConsulPeer,
},
Uid: "ABCD", // We add this to show it does not factor into the comparison
}
Loading

0 comments on commit 258fe4d

Please sign in to comment.