Skip to content

Commit 131eddc

Browse files
authored
cleanup: simplify endpointpickerconfig (#1324)
* remove inline of endpointconfig * simplify extension ref * remove inline * remove inline * fixed ut * fixed verify
1 parent cf0bcad commit 131eddc

22 files changed

+68
-466
lines changed

api/v1/inferencepool_types.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ type InferencePoolSpec struct {
6969
// +kubebuilder:validation:Required
7070
TargetPortNumber int32 `json:"targetPortNumber"`
7171

72-
// EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint
73-
// picker service that picks endpoints for the requests routed to this pool.
74-
EndpointPickerConfig `json:",inline"`
75-
}
76-
77-
// EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint picker extension.
78-
// This type is intended to be a union of mutually exclusive configuration options that we may add in the future.
79-
type EndpointPickerConfig struct {
8072
// Extension configures an endpoint picker as an extension service.
8173
//
8274
// +kubebuilder:validation:Required
@@ -85,21 +77,6 @@ type EndpointPickerConfig struct {
8577

8678
// Extension specifies how to configure an extension that runs the endpoint picker.
8779
type Extension struct {
88-
// Reference is a reference to a service extension. When ExtensionReference is invalid,
89-
// a 5XX status code MUST be returned for the request that would have otherwise been routed
90-
// to the invalid backend.
91-
ExtensionReference `json:",inline"`
92-
93-
// ExtensionConnection configures the connection between the Gateway and the extension.
94-
ExtensionConnection `json:",inline"`
95-
}
96-
97-
// ExtensionReference is a reference to the extension.
98-
//
99-
// If a reference is invalid, the implementation MUST update the `ResolvedRefs`
100-
// Condition on the InferencePool's status to `status: False`. A 5XX status code MUST be returned
101-
// for the request that would have otherwise been routed to the invalid backend.
102-
type ExtensionReference struct {
10380
// Group is the group of the referent.
10481
// The default value is "", representing the Core API group.
10582
//
@@ -132,10 +109,7 @@ type ExtensionReference struct {
132109
//
133110
// +optional
134111
PortNumber *PortNumber `json:"portNumber,omitempty"`
135-
}
136112

137-
// ExtensionConnection encapsulates options that configures the connection to the extension.
138-
type ExtensionConnection struct {
139113
// Configures how the gateway handles the case when the extension is not responsive.
140114
// Defaults to failClose.
141115
//
@@ -261,7 +235,7 @@ const (
261235
InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs"
262236

263237
// This reason is used with the "ResolvedRefs" condition when the
264-
// ExtensionRef is invalid in some way. This can include an unsupported kind
238+
// Extension is invalid in some way. This can include an unsupported kind
265239
// or API group, or a reference to a resource that can not be found.
266240
InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
267241
)

api/v1/zz_generated.deepcopy.go

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

apix/v1alpha2/inferencepool_types.go

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,6 @@ type EndpointPickerConfig struct {
8585

8686
// Extension specifies how to configure an extension that runs the endpoint picker.
8787
type Extension struct {
88-
// Reference is a reference to a service extension. When ExtensionReference is invalid,
89-
// a 5XX status code MUST be returned for the request that would have otherwise been routed
90-
// to the invalid backend.
91-
ExtensionReference `json:",inline"`
92-
93-
// ExtensionConnection configures the connection between the Gateway and the extension.
94-
ExtensionConnection `json:",inline"`
95-
}
96-
97-
// ExtensionReference is a reference to the extension.
98-
//
99-
// Connections to this extension MUST use TLS by default. Implementations MAY
100-
// provide a way to customize this connection to use cleartext, a different
101-
// protocol, or custom TLS configuration.
102-
//
103-
// If a reference is invalid, the implementation MUST update the `ResolvedRefs`
104-
// Condition on the InferencePool's status to `status: False`. A 5XX status code
105-
// MUST be returned for the request that would have otherwise been routed to the
106-
// invalid backend.
107-
type ExtensionReference struct {
10888
// Group is the group of the referent.
10989
// The default value is "", representing the Core API group.
11090
//
@@ -137,10 +117,7 @@ type ExtensionReference struct {
137117
//
138118
// +optional
139119
PortNumber *PortNumber `json:"portNumber,omitempty"`
140-
}
141120

142-
// ExtensionConnection encapsulates options that configures the connection to the extension.
143-
type ExtensionConnection struct {
144121
// Configures how the gateway handles the case when the extension is not responsive.
145122
// Defaults to failClose.
146123
//
@@ -266,7 +243,7 @@ const (
266243
InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs"
267244

268245
// This reason is used with the "ResolvedRefs" condition when the
269-
// ExtensionRef is invalid in some way. This can include an unsupported kind
246+
// Extension is invalid in some way. This can include an unsupported kind
270247
// or API group, or a reference to a resource that can not be found.
271248
InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
272249
)

apix/v1alpha2/zz_generated.deepcopy.go

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

client-go/applyconfiguration/api/v1/endpointpickerconfig.go

Lines changed: 0 additions & 39 deletions
This file was deleted.

client-go/applyconfiguration/api/v1/extension.go

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

0 commit comments

Comments
 (0)