Skip to content

Commit 3ab409d

Browse files
authored
fix: make extensionRef to be optional (#1365)
* change to be non-pointer * change to non-nil pointer in v1a2 * make extensionRef optional
1 parent 26c460e commit 3ab409d

File tree

13 files changed

+23
-27
lines changed

13 files changed

+23
-27
lines changed

api/v1/inferencepool_types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ type InferencePoolSpec struct {
7171
TargetPortNumber int32 `json:"targetPortNumber"`
7272

7373
// Extension configures an endpoint picker as an extension service.
74-
//
75-
// +kubebuilder:validation:Required
7674
ExtensionRef *Extension `json:"extensionRef,omitempty"`
7775
}
7876

apix/v1alpha2/inferencepool_types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ type InferencePoolSpec struct {
7878
// This type is intended to be a union of mutually exclusive configuration options that we may add in the future.
7979
type EndpointPickerConfig struct {
8080
// Extension configures an endpoint picker as an extension service.
81-
//
82-
// +kubebuilder:validation:Required
8381
ExtensionRef *Extension `json:"extensionRef,omitempty"`
8482
}
8583

config/crd/bases/inference.networking.k8s.io_inferencepools.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ spec:
140140
minimum: 1
141141
type: integer
142142
required:
143-
- extensionRef
144143
- selector
145144
- targetPortNumber
146145
type: object

config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ spec:
130130
minimum: 1
131131
type: integer
132132
required:
133-
- extensionRef
134133
- selector
135134
- targetPortNumber
136135
type: object

conformance/conformance.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
// Package conformance contains the core setup and execution logic
18-
// for the Gateway API Inference ExtensionRef conformance test suite.
18+
// for the Gateway API Inference Extension conformance test suite.
1919
package conformance
2020

2121
import (
@@ -54,7 +54,7 @@ import (
5454
)
5555

5656
// GatewayLayerProfileName defines the name for the conformance profile that tests
57-
// the Gateway API layer aspects of the Inference ExtensionRef (e.g., InferencePool, InferenceObjective CRDs).
57+
// the Gateway API layer aspects of the Inference Extension (e.g., InferencePool, InferenceObjective CRDs).
5858
// Future profiles will cover EPP and ModelServer layers.
5959
const GatewayLayerProfileName confsuite.ConformanceProfileName = "Gateway"
6060

@@ -66,7 +66,7 @@ const GatewayLayerProfileName confsuite.ConformanceProfileName = "Gateway"
6666
const SupportInferencePool features.FeatureName = "SupportInferencePool"
6767

6868
// InferenceCoreFeatures defines the core features that implementations
69-
// of the "Gateway" profile for the Inference ExtensionRef MUST support.
69+
// of the "Gateway" profile for the Inference Extension MUST support.
7070
var InferenceCoreFeatures = sets.New(
7171
features.SupportGateway, // This is needed to ensure manifest gets applied during setup.
7272
features.SupportHTTPRoute,
@@ -104,7 +104,7 @@ func DefaultOptions(t *testing.T) confsuite.ConformanceOptions {
104104
// Add APIExtensions types (for CRDs)
105105
require.NoError(t, apiextensionsv1.AddToScheme(scheme), "failed to add apiextensionsv1 types to scheme")
106106

107-
// Register Inference ExtensionRef API types
107+
// Register Inference Extension API types
108108
t.Logf("Attempting to install inferencev1alpha2 types into scheme from package: %s", inferencev1alpha2.GroupName)
109109
require.NoError(t, inferencev1alpha2.Install(scheme), "failed to install inferencev1alpha2 types into scheme")
110110
t.Logf("Attempting to install inferencev1 types into scheme from package: %s", inferencev1.GroupName)
@@ -134,7 +134,7 @@ func DefaultOptions(t *testing.T) confsuite.ConformanceOptions {
134134
*confflags.ImplementationContact,
135135
)
136136

137-
// Inference ExtensionRef Specific Report Fields
137+
// Inference Extension Specific Report Fields
138138
inferenceExtensionVersion := "v0.3.0"
139139
_ = inferenceExtensionVersion // Avoid unused variable error until implemented
140140

@@ -189,15 +189,15 @@ func DefaultOptions(t *testing.T) confsuite.ConformanceOptions {
189189
return opts
190190
}
191191

192-
// RunConformance runs the Inference ExtensionRef conformance tests using default options.
192+
// RunConformance runs the Inference Extension conformance tests using default options.
193193
func RunConformance(t *testing.T) {
194194
RunConformanceWithOptions(t, DefaultOptions(t))
195195
}
196196

197-
// RunConformanceWithOptions runs the Inference ExtensionRef conformance tests with specific options.
197+
// RunConformanceWithOptions runs the Inference Extension conformance tests with specific options.
198198
func RunConformanceWithOptions(t *testing.T, opts confsuite.ConformanceOptions) {
199199
t.Helper()
200-
t.Logf("Running Inference ExtensionRef conformance tests with GatewayClass %s", opts.GatewayClassName)
200+
t.Logf("Running Inference Extension conformance tests with GatewayClass %s", opts.GatewayClassName)
201201
logDebugf(t, opts.Debug, "RunConformanceWithOptions: BaseManifests path being used by opts: %q", opts.BaseManifests)
202202

203203
// Register the GatewayLayerProfile with the suite runner.
@@ -211,13 +211,13 @@ func RunConformanceWithOptions(t *testing.T, opts confsuite.ConformanceOptions)
211211

212212
SetupConformanceTestSuite(t, cSuite, opts, tests.ConformanceTests)
213213

214-
t.Log("Running Inference ExtensionRef conformance tests against all registered tests")
214+
t.Log("Running Inference Extension conformance tests against all registered tests")
215215
err = cSuite.Run(t, tests.ConformanceTests)
216216
require.NoError(t, err, "error running conformance tests")
217217

218218
// Generate and write the report if requested.
219219
if opts.ReportOutputPath != "" {
220-
t.Log("Generating Inference ExtensionRef conformance report")
220+
t.Log("Generating Inference Extension conformance report")
221221
report, err := cSuite.Report() // Use the existing report generation logic.
222222
require.NoError(t, err, "error generating conformance report")
223223
inferenceReport := GatewayAPIInferenceExtensionConformanceReport{

conformance/conformancereport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
// Package conformance contains the core setup and execution logic
18-
// for the Gateway API Inference ExtensionRef conformance test suite.
18+
// for the Gateway API Inference Extension conformance test suite.
1919
package conformance
2020

2121
import (

conformance/tests/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package tests is the root package for all Gateway API Inference ExtensionRef
17+
// Package tests is the root package for all Gateway API Inference Extension
1818
// conformance test implementations.
1919
package tests
2020

@@ -30,6 +30,6 @@ import (
3030
)
3131

3232
// ConformanceTests holds all the conformance tests definitions for the
33-
// Gateway API Inference ExtensionRef suite. Tests are registered from other packages
33+
// Gateway API Inference Extension suite. Tests are registered from other packages
3434
// using init() functions like the one in the basic package.
3535
var ConformanceTests []suite.ConformanceTest

conformance/utils/assertions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ limitations under the License.
1515
*/
1616

1717
// Package assertions contains custom assertion helper functions used within
18-
// the Gateway API Inference ExtensionRef conformance test suite.
18+
// the Gateway API Inference Extension conformance test suite.
1919
package assertions
2020

21-
// TODO: Implement custom assertion functions specific to Inference ExtensionRef testing.
21+
// TODO: Implement custom assertion functions specific to Inference Extension testing.
2222
// Examples might include:
2323
// - Asserting specific fields or structures within an inference API response body.
2424
// - Asserting specific metrics reported by mock model servers or EPPs.

pkg/epp/controller/inferencepool_reconciler_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ func TestInferencePoolReconciler(t *testing.T) {
8080
pool1 := utiltest.MakeInferencePool("pool1").
8181
Namespace("pool1-ns").
8282
Selector(selector_v1).
83+
ExtensionRef("epp-service").
8384
TargetPortNumber(8080).ObjRef()
8485
pool1.SetGroupVersionKind(gvk)
85-
pool2 := utiltest.MakeInferencePool("pool2").Namespace("pool2-ns").ObjRef()
86+
pool2 := utiltest.MakeInferencePool("pool2").Namespace("pool2-ns").ExtensionRef("epp-service").ObjRef()
8687
pool2.SetGroupVersionKind(gvk)
8788

8889
// Set up the scheme.
@@ -221,8 +222,9 @@ func TestXInferencePoolReconciler(t *testing.T) {
221222
pool1 := utiltest.MakeXInferencePool("pool1").
222223
Namespace("pool1-ns").
223224
Selector(selector_v1).
225+
ExtensionRef("epp-service").
224226
TargetPortNumber(8080).ObjRef()
225-
pool2 := utiltest.MakeXInferencePool("pool2").Namespace("pool2-ns").ObjRef()
227+
pool2 := utiltest.MakeXInferencePool("pool2").Namespace("pool2-ns").ExtensionRef("epp-service").ObjRef()
226228
pool1.SetGroupVersionKind(gvk)
227229
pool2.SetGroupVersionKind(gvk)
228230

pkg/epp/flowcontrol/controller/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ limitations under the License.
4747
// # Architectural Deep Dive: The `EnqueueAndWait` Model
4848
//
4949
// A fundamental design choice is the synchronous, blocking `EnqueueAndWait` method. In the context of the Gateway API
50-
// Inference ExtensionRef's Endpoint Picker (EPP), which operates as an Envoy External Processing (`ext_proc`) server, this
50+
// Inference Extension's Endpoint Picker (EPP), which operates as an Envoy External Processing (`ext_proc`) server, this
5151
// model is deliberately chosen for its simplicity and robustness.
5252
//
5353
// - Alignment with `ext_proc`: The `ext_proc` protocol is stream-based. A single goroutine within the EPP manages the

0 commit comments

Comments
 (0)