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
  • Loading branch information
NiniOak authored and jm96441n committed Feb 6, 2024
1 parent 0a82ff2 commit 2364419
Show file tree
Hide file tree
Showing 35 changed files with 41 additions and 287 deletions.
7 changes: 0 additions & 7 deletions charts/consul/templates/crd-apigateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-grpcroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-httproutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
23 changes: 6 additions & 17 deletions charts/consul/templates/crd-tcproutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
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
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{}),
Expand Down Expand Up @@ -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
}
Expand Down
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
Expand Up @@ -16,7 +16,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 (
Expand Down Expand Up @@ -77,10 +76,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,
},
}
}
Expand Down
5 changes: 0 additions & 5 deletions control-plane/api/mesh/v2beta1/gateway_class_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -58,10 +57,6 @@ func (in *GatewayClass) 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,
},
}
}
Expand Down
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
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
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
Expand Up @@ -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{}),
Expand Down Expand Up @@ -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
}
Expand Down
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
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
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
Expand Up @@ -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{}),
Expand Down Expand Up @@ -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
}
Expand Down
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
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
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
Expand Up @@ -16,7 +16,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 (
Expand Down Expand Up @@ -59,10 +58,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,
},
}
}
Expand Down
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
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
},
}
}
Expand Down
Loading

0 comments on commit 2364419

Please sign in to comment.