Skip to content

API Discrepancy: InferencePoolSpec pod selector field name mismatch between API Proposal 002 and current Go type definition #766

Closed
@SinaChavoshi

Description

@SinaChavoshi

Description:

There is a discrepancy in the naming of the field used for selecting model server pods within the InferencePoolSpec between the definition in API Proposal 002 and the current Go type definition in api/v1alpha2/inferencepool_types.go.

Details:

  1. API Proposal 002:

    • Defined the field for selecting model server pods as:
      • Go field name (implied): ModelServerSelector
      • JSON/YAML field name: modelServerSelector
      • Type: map[string]string
    • Reference: "gateway-api-inference-extension/docs/proposals/002-api-proposal/"
      type InferencePoolSpec struct {
              // ModelServerSelector uses label selection to watch model server pods
              // that should be included in the InferencePool.
              ModelServerSelector map[string]string `json:"modelServerSelector,omitempty"`
      }
  2. Current Go Type Definition (api/v1alpha2/inferencepool_types.go):

    • The field for selecting model server pods is currently defined as:
      • Go field name: Selector
      • JSON/YAML field name: selector
      • Type: map[LabelKey]LabelValue (effectively map[string]string)
    • Current struct snippet:
      type InferencePoolSpec struct {
          // Selector defines a map of labels to watch model server pods
          // that should be included in the InferencePool.
          // ...
          // +kubebuilder:validation:Required
          Selector map[LabelKey]LabelValue `json:"selector"`
          // ...
      }

Impact:

  • Conformance Test Mismatches: Conformance tests written based on API Proposal 002 (expecting ModelServerSelector) will encounter Go compiler errors (e.g., Spec.ModelServerSelector undefined) when run against the current Go types.
  • YAML Manifest Discrepancy: If YAML manifests use modelServerSelector (as per the proposal), they will not be correctly unmarshalled into the Go struct which expects selector (and vice-versa).

Action Required:

  • Discuss and decide on the canonical name for this field (ModelServerSelector vs. Selector) and its corresponding JSON tag.
  • Update either the API Proposal 002 document or the Go type definition (and subsequently the CRD definition generated from it) to ensure consistency.
  • Update any affected conformance tests and documentation once the naming is standardized.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions