Skip to content

Commit 33bde7e

Browse files
committed
target group merging logic
1 parent 0a5fb76 commit 33bde7e

14 files changed

+1086
-200
lines changed

apis/gateway/v1beta1/targetgroupconfig_types.go

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,26 @@ type TargetGroupConfigurationSpec struct {
153153
// targetReference the kubernetes object to attach the Target Group settings to.
154154
TargetReference Reference `json:"targetReference"`
155155

156-
// mergeMode the mode to use for merging the identified per-route configuration and default configuration.
157-
158156
// defaultRouteConfiguration fallback configuration applied to all routes, unless overridden by route-specific configurations.
159157
// +optional
160158
DefaultConfiguration TargetGroupProps `json:"defaultConfiguration,omitempty"`
161159

162-
// routeConfigurations the route configuration for specific routes
160+
// routeConfigurations the route configuration for specific routes. the longest prefix match (kind:namespace:name) is taken to combine with the default properties.
163161
// +optional
164162
RouteConfigurations []RouteConfiguration `json:"routeConfigurations,omitempty"`
165163
}
166164

167-
// +kubebuilder:validation:Pattern="^(HTTPRoute|TLSRoute|TCPRoute|UDPRoute|GRPCRoute)?:([^:]+)?:([^:]+)?$"
168-
type RouteIdentifier string
165+
// RouteIdentifier the complete set of route attributes that identify a route.
166+
type RouteIdentifier struct {
167+
RouteKind string `json:"kind,omitempty"`
168+
RouteNamespace string `json:"namespace,omitempty"`
169+
RouteName string `json:"name,omitempty"`
170+
}
169171

170172
// RouteConfiguration defines the per route configuration
171173
type RouteConfiguration struct {
172174
// name the identifier of the route, it should be in the form of ROUTE:NAMESPACE:NAME
173-
Identifier RouteIdentifier `json:"identifier"`
175+
RouteIdentifier RouteIdentifier `json:"routeIdentifier"`
174176

175177
// targetGroupProps the target group specific properties
176178
TargetGroupProps TargetGroupProps `json:"targetGroupProps"`
@@ -180,7 +182,7 @@ type RouteConfiguration struct {
180182
type TargetGroupProps struct {
181183
// targetGroupName specifies the name to assign to the Target Group. If not defined, then one is generated.
182184
// +optional
183-
TargetGroupName string `json:"targetGroupName,omitempty"`
185+
TargetGroupName *string `json:"targetGroupName,omitempty"`
184186

185187
// ipAddressType specifies whether the target group is of type IPv4 or IPv6. If unspecified, it will be automatically inferred.
186188
// +optional
@@ -214,15 +216,11 @@ type TargetGroupProps struct {
214216
// EnableMultiCluster [Application / Network LoadBalancer]
215217
// Allows for multiple Clusters / Services to use the generated TargetGroup ARN
216218
// +optional
217-
EnableMultiCluster bool `json:"enableMultiCluster,omitempty"`
219+
EnableMultiCluster *bool `json:"enableMultiCluster,omitempty"`
218220

219-
// vpcID is the VPC of the TargetGroup. If unspecified, it will be automatically inferred.
221+
// Tags the Tags to add on the target group.
220222
// +optional
221-
VpcID *string `json:"vpcID,omitempty"`
222-
223-
// Tags defines list of Tags on target group.
224-
// +optional
225-
Tags []Tag `json:"tags,omitempty"`
223+
Tags *map[string]string `json:"tags,omitempty"`
226224
}
227225

228226
// TargetGroupAttribute defines target group attribute.
@@ -234,15 +232,6 @@ type TargetGroupAttribute struct {
234232
Value string `json:"value"`
235233
}
236234

237-
// Tag defines a AWS Tag on resources.
238-
type Tag struct {
239-
// The key of the tag.
240-
Key string `json:"key"`
241-
242-
// The value of the tag.
243-
Value string `json:"value"`
244-
}
245-
246235
// TODO -- these can be used to set what generation the gateway is currently on to track progress on reconcile.
247236

248237
// TargetGroupConfigurationStatus defines the observed state of TargetGroupConfiguration

apis/gateway/v1beta1/zz_generated.deepcopy.go

Lines changed: 32 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)