From ec4dd297a0769f792288f51e71af701ed01f2316 Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Fri, 26 Sep 2025 10:31:38 -0700 Subject: [PATCH 1/2] Multi-Cluster: Adds v1alpha1 API Types and Docs Signed-off-by: Daneyon Hansen --- Makefile | 17 +- api/v1/inferencepool_types.go | 60 ++++ apix/v1alpha1/doc.go | 22 ++ apix/v1alpha1/inferencepoolimport_types.go | 145 ++++++++ apix/v1alpha1/shared_types.go | 24 ++ apix/v1alpha1/zz_generated.deepcopy.go | 172 +++++++++ apix/v1alpha1/zz_generated.register.go | 70 ++++ .../applyconfiguration/api/v1/parentstatus.go | 14 +- .../apix/v1alpha1/exportingcluster.go | 39 ++ .../apix/v1alpha1/importcontroller.go | 87 +++++ .../apix/v1alpha1/inferencepoolimport.go | 243 +++++++++++++ .../v1alpha1/inferencepoolimportstatus.go | 44 +++ client-go/applyconfiguration/utils.go | 12 + client-go/clientset/versioned/clientset.go | 13 + .../versioned/fake/clientset_generated.go | 7 + .../clientset/versioned/fake/register.go | 2 + .../clientset/versioned/scheme/register.go | 2 + .../typed/apix/v1alpha1/apix_client.go | 101 ++++++ .../versioned/typed/apix/v1alpha1/doc.go | 20 ++ .../versioned/typed/apix/v1alpha1/fake/doc.go | 20 ++ .../apix/v1alpha1/fake/fake_apix_client.go | 40 +++ .../v1alpha1/fake/fake_inferencepoolimport.go | 53 +++ .../apix/v1alpha1/generated_expansion.go | 21 ++ .../apix/v1alpha1/inferencepoolimport.go | 74 ++++ .../externalversions/apix/interface.go | 8 + .../apix/v1alpha1/inferencepoolimport.go | 102 ++++++ .../apix/v1alpha1/interface.go | 45 +++ .../informers/externalversions/generic.go | 5 + .../apix/v1alpha1/expansion_generated.go | 27 ++ .../apix/v1alpha1/inferencepoolimport.go | 70 ++++ ...ence.networking.k8s.io_inferencepools.yaml | 20 ++ ...working.x-k8s.io_inferencepoolimports.yaml | 334 ++++++++++++++++++ crd-ref-docs.yaml | 2 +- mkdocs.yml | 8 +- pkg/generator/main.go | 1 + site-src/api-types/inferenceobjective.md | 2 +- site-src/api-types/inferencepoolimport.md | 26 ++ site-src/reference/spec.md | 27 ++ site-src/reference/x-v1a1-spec.md | 125 +++++++ .../reference/{x-spec.md => x-v1a2-spec.md} | 0 40 files changed, 2095 insertions(+), 9 deletions(-) create mode 100644 apix/v1alpha1/doc.go create mode 100644 apix/v1alpha1/inferencepoolimport_types.go create mode 100644 apix/v1alpha1/shared_types.go create mode 100644 apix/v1alpha1/zz_generated.deepcopy.go create mode 100644 apix/v1alpha1/zz_generated.register.go create mode 100644 client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go create mode 100644 client-go/applyconfiguration/apix/v1alpha1/importcontroller.go create mode 100644 client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go create mode 100644 client-go/applyconfiguration/apix/v1alpha1/inferencepoolimportstatus.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/apix_client.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/doc.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/fake/doc.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_apix_client.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_inferencepoolimport.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/generated_expansion.go create mode 100644 client-go/clientset/versioned/typed/apix/v1alpha1/inferencepoolimport.go create mode 100644 client-go/informers/externalversions/apix/v1alpha1/inferencepoolimport.go create mode 100644 client-go/informers/externalversions/apix/v1alpha1/interface.go create mode 100644 client-go/listers/apix/v1alpha1/expansion_generated.go create mode 100644 client-go/listers/apix/v1alpha1/inferencepoolimport.go create mode 100644 config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml create mode 100644 site-src/api-types/inferencepoolimport.md create mode 100644 site-src/reference/x-v1a1-spec.md rename site-src/reference/{x-spec.md => x-v1a2-spec.md} (100%) diff --git a/Makefile b/Makefile index c483be79b..61936fd51 100644 --- a/Makefile +++ b/Makefile @@ -307,13 +307,24 @@ live-docs: docker build -t gaie/mkdocs hack/mkdocs/image docker run --rm -it -p 3000:3000 -v ${PWD}:/docs gaie/mkdocs -.PHONY: apix-ref-docs -apix-ref-docs: crd-ref-docs +.PHONY: api-ref-docs-all +api-ref-docs-all: apix-v1a1-ref-docs apix-v1a2-ref-docs api-ref-docs + +.PHONY: apix-v1a1-ref-docs +apix-v1a1-ref-docs: crd-ref-docs + ${CRD_REF_DOCS} \ + --source-path=${PWD}/apix/v1alpha1 \ + --config=crd-ref-docs.yaml \ + --renderer=markdown \ + --output-path=${PWD}/site-src/reference/x-v1a1-spec.md + +.PHONY: apix-v1a2-ref-docs +apix-v1a2-ref-docs: crd-ref-docs ${CRD_REF_DOCS} \ --source-path=${PWD}/apix/v1alpha2 \ --config=crd-ref-docs.yaml \ --renderer=markdown \ - --output-path=${PWD}/site-src/reference/x-spec.md + --output-path=${PWD}/site-src/reference/x-v1a2-spec.md .PHONY: api-ref-docs api-ref-docs: crd-ref-docs diff --git a/api/v1/inferencepool_types.go b/api/v1/inferencepool_types.go index 76026df64..4efac08f6 100644 --- a/api/v1/inferencepool_types.go +++ b/api/v1/inferencepool_types.go @@ -202,8 +202,42 @@ type ParentStatus struct { // // +required ParentRef ParentReference `json:"parentRef,omitzero"` + + // ControllerName is a domain/path string that indicates the name of the controller that + // wrote this status. This corresponds with the GatewayClass controllerName field when the + // parentRef references a Gateway kind. + // + // Example: "example.net/gateway-controller". + // + // The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names: + // + // https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // + // Controllers MUST populate this field when writing status. Controllers should ensure that + // entries to status populated with their ControllerName are cleaned up when they are no + // longer necessary. + // + // +required + ControllerName ParentController `json:"controllerName"` } +// ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed +// path. +// +// Valid values include: +// +// * "example.com/bar" +// +// Invalid values include: +// +// * "example.com" - must include path +// * "foo.example.com" - must include path +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` +type ParentController string + // InferencePoolConditionType is a type of status condition for the InferencePool. type InferencePoolConditionType string @@ -274,6 +308,32 @@ const ( InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef" ) +const ( + // InferencePoolConditionExported is a type of condition that indicates whether the + // controller was able to export the InferencePool to the specified clusters. + // + // Possible reasons for this condition to be True are: + // + // * "Exported" + // + // Possible reasons for this condition to be False are: + // + // * "Invalid" + // + // Controllers MAY raise this condition with other reasons, but should + // prefer to use the reasons listed above to improve interoperability. + InferencePoolConditionExported InferencePoolConditionType = "Exported" + + // InferencePoolReasonExported is a reason used with the "Exported" condition when the + // condition is true. + InferencePoolReasonExported InferencePoolReason = "Exported" + + // InferencePoolReasonInvalid is a reason used with the "Exported" condition when the + // InferencePool cannot be exported for some reason. A controller should provide + // additional information in the condition message. + InferencePoolReasonInvalid InferencePoolReason = "Invalid" +) + // ParentReference identifies an API object. It is used to associate the InferencePool with a // parent resource, such as a Gateway. type ParentReference struct { diff --git a/apix/v1alpha1/doc.go b/apix/v1alpha1/doc.go new file mode 100644 index 000000000..122c3b952 --- /dev/null +++ b/apix/v1alpha1/doc.go @@ -0,0 +1,22 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the +// inference.networking.x-k8s.io API group. +// +// +kubebuilder:object:generate=true +// +groupName=inference.networking.x-k8s.io +package v1alpha1 diff --git a/apix/v1alpha1/inferencepoolimport_types.go b/apix/v1alpha1/inferencepoolimport_types.go new file mode 100644 index 000000000..55d5460b0 --- /dev/null +++ b/apix/v1alpha1/inferencepoolimport_types.go @@ -0,0 +1,145 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// InferencePoolImport is the Schema for the InferencePoolImports API. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=infpimp +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +genclient +type InferencePoolImport struct { + metav1.TypeMeta `json:",inline"` + + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of the InferencePoolImport. + // + // +required + Spec InferencePoolImportSpec `json:"spec,omitzero"` + + // Status defines the observed state of the InferencePoolImport. + // + // +optional + //nolint:kubeapilinter // status should not be a pointer. + Status InferencePoolImportStatus `json:"status,omitempty"` +} + +// InferencePoolImportList contains a list of InferencePoolImports. +// +// +kubebuilder:object:root=true +type InferencePoolImportList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []InferencePoolImport `json:"items"` +} + +// InferencePoolImportSpec defines the desired state of the InferencePoolImport. +type InferencePoolImportSpec struct {} + +// InferencePoolImportStatus defines the observed state of the InferencePoolImport. +type InferencePoolImportStatus struct { + // Controllers is a list of controllers that are responsible for managing the InferencePoolImport. + // + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:validation:Required + Controllers []ImportController `json:"controllers"` +} + +// ImportController defines a controller that is responsible for managing the InferencePoolImport. +type ImportController struct { + // Name is a domain/path string that indicates the name of the controller that manages the + // InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the + // controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific. + // + // Example: "example.net/import-controller". + // + // The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes + // names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). + // + // A controller MUST populate this field when writing status and ensure that entries to status + // populated with their controller name are removed when they are no longer necessary. + // + // +required + Name ControllerName `json:"name"` + + // ExportingClusters is a list of clusters that exported the InferencePool(s) that back the + // InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport + // from the exported InferencePool(s). + // + // +optional + ExportingClusters []ExportingCluster `json:"exportingClusters,omitempty"` + + // Parents is a list of parent resources, typically Gateways, that are associated with the + // InferencePoolImport, and the status of the InferencePoolImport with respect to each parent. + // + // Ancestor would be a more accurate name, but Parent is consistent with InferencePool terminology. + // + // Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller + // must add an entry for each parent it manages and remove the parent entry when the controller no longer + // considers the InferencePoolImport to be associated with that parent. + // + // +optional + // +listType=atomic + Parents []v1.ParentStatus `json:"parents,omitempty"` + + // Conditions track the state of the InferencePoolImport. + // + // Known condition types are: + // + // * "Accepted" + // + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=8 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// ControllerName is the name of a controller that manages a resource. It must be a domain prefixed path. +// +// Valid values include: +// +// * "example.com/bar" +// +// Invalid values include: +// +// * "example.com" - must include path +// * "foo.example.com" - must include path +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` +type ControllerName string + +// ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport. +type ExportingCluster struct { + // Name of the exporting cluster (must be unique within the list). + // + // +kubebuilder:validation:Required + Name string `json:"name"` +} diff --git a/apix/v1alpha1/shared_types.go b/apix/v1alpha1/shared_types.go new file mode 100644 index 000000000..56fd71d33 --- /dev/null +++ b/apix/v1alpha1/shared_types.go @@ -0,0 +1,24 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// ExportAnnotationKey is the annotation key used to export an InferencePool. +var ExportAnnotationKey = "inference.networking.x-k8s.io/export" + +// ExportAnnotationVal is the annotation value used to export an InferencePool +// to all clusters. +var ExportAnnotationVal = "ClusterSet" diff --git a/apix/v1alpha1/zz_generated.deepcopy.go b/apix/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..4a8cd78e4 --- /dev/null +++ b/apix/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,172 @@ +//go:build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExportingCluster) DeepCopyInto(out *ExportingCluster) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportingCluster. +func (in *ExportingCluster) DeepCopy() *ExportingCluster { + if in == nil { + return nil + } + out := new(ExportingCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImportController) DeepCopyInto(out *ImportController) { + *out = *in + if in.ExportingClusters != nil { + in, out := &in.ExportingClusters, &out.ExportingClusters + *out = make([]ExportingCluster, len(*in)) + copy(*out, *in) + } + if in.Parents != nil { + in, out := &in.Parents, &out.Parents + *out = make([]v1.ParentStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportController. +func (in *ImportController) DeepCopy() *ImportController { + if in == nil { + return nil + } + out := new(ImportController) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePoolImport) DeepCopyInto(out *InferencePoolImport) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolImport. +func (in *InferencePoolImport) DeepCopy() *InferencePoolImport { + if in == nil { + return nil + } + out := new(InferencePoolImport) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InferencePoolImport) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePoolImportList) DeepCopyInto(out *InferencePoolImportList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InferencePoolImport, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolImportList. +func (in *InferencePoolImportList) DeepCopy() *InferencePoolImportList { + if in == nil { + return nil + } + out := new(InferencePoolImportList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InferencePoolImportList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePoolImportSpec) DeepCopyInto(out *InferencePoolImportSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolImportSpec. +func (in *InferencePoolImportSpec) DeepCopy() *InferencePoolImportSpec { + if in == nil { + return nil + } + out := new(InferencePoolImportSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePoolImportStatus) DeepCopyInto(out *InferencePoolImportStatus) { + *out = *in + if in.Controllers != nil { + in, out := &in.Controllers, &out.Controllers + *out = make([]ImportController, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolImportStatus. +func (in *InferencePoolImportStatus) DeepCopy() *InferencePoolImportStatus { + if in == nil { + return nil + } + out := new(InferencePoolImportStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apix/v1alpha1/zz_generated.register.go b/apix/v1alpha1/zz_generated.register.go new file mode 100644 index 000000000..4894b76aa --- /dev/null +++ b/apix/v1alpha1/zz_generated.register.go @@ -0,0 +1,70 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by register-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "inference.networking.x-k8s.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &InferencePoolImport{}, + &InferencePoolImportList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + v1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/client-go/applyconfiguration/api/v1/parentstatus.go b/client-go/applyconfiguration/api/v1/parentstatus.go index 5accb0f45..b8940e204 100644 --- a/client-go/applyconfiguration/api/v1/parentstatus.go +++ b/client-go/applyconfiguration/api/v1/parentstatus.go @@ -20,13 +20,15 @@ package v1 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" ) // ParentStatusApplyConfiguration represents a declarative configuration of the ParentStatus type for use // with apply. type ParentStatusApplyConfiguration struct { - Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` - ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` + ControllerName *apiv1.ParentController `json:"controllerName,omitempty"` } // ParentStatusApplyConfiguration constructs a declarative configuration of the ParentStatus type for use with @@ -55,3 +57,11 @@ func (b *ParentStatusApplyConfiguration) WithParentRef(value *ParentReferenceApp b.ParentRef = value return b } + +// WithControllerName sets the ControllerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerName field is set to the value of the last call. +func (b *ParentStatusApplyConfiguration) WithControllerName(value apiv1.ParentController) *ParentStatusApplyConfiguration { + b.ControllerName = &value + return b +} diff --git a/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go b/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go new file mode 100644 index 000000000..cc8d8455b --- /dev/null +++ b/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// ExportingClusterApplyConfiguration represents a declarative configuration of the ExportingCluster type for use +// with apply. +type ExportingClusterApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ExportingClusterApplyConfiguration constructs a declarative configuration of the ExportingCluster type for use with +// apply. +func ExportingCluster() *ExportingClusterApplyConfiguration { + return &ExportingClusterApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ExportingClusterApplyConfiguration) WithName(value string) *ExportingClusterApplyConfiguration { + b.Name = &value + return b +} diff --git a/client-go/applyconfiguration/apix/v1alpha1/importcontroller.go b/client-go/applyconfiguration/apix/v1alpha1/importcontroller.go new file mode 100644 index 000000000..1c30787ed --- /dev/null +++ b/client-go/applyconfiguration/apix/v1alpha1/importcontroller.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" + v1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1" +) + +// ImportControllerApplyConfiguration represents a declarative configuration of the ImportController type for use +// with apply. +type ImportControllerApplyConfiguration struct { + Name *apixv1alpha1.ControllerName `json:"name,omitempty"` + ExportingClusters []ExportingClusterApplyConfiguration `json:"exportingClusters,omitempty"` + Parents []v1.ParentStatusApplyConfiguration `json:"parents,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ImportControllerApplyConfiguration constructs a declarative configuration of the ImportController type for use with +// apply. +func ImportController() *ImportControllerApplyConfiguration { + return &ImportControllerApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ImportControllerApplyConfiguration) WithName(value apixv1alpha1.ControllerName) *ImportControllerApplyConfiguration { + b.Name = &value + return b +} + +// WithExportingClusters adds the given value to the ExportingClusters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ExportingClusters field. +func (b *ImportControllerApplyConfiguration) WithExportingClusters(values ...*ExportingClusterApplyConfiguration) *ImportControllerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExportingClusters") + } + b.ExportingClusters = append(b.ExportingClusters, *values[i]) + } + return b +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *ImportControllerApplyConfiguration) WithParents(values ...*v1.ParentStatusApplyConfiguration) *ImportControllerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ImportControllerApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ImportControllerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go new file mode 100644 index 000000000..9e4adfd7d --- /dev/null +++ b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go @@ -0,0 +1,243 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" +) + +// InferencePoolImportApplyConfiguration represents a declarative configuration of the InferencePoolImport type for use +// with apply. +type InferencePoolImportApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *apixv1alpha1.InferencePoolImportSpec `json:"spec,omitempty"` + Status *InferencePoolImportStatusApplyConfiguration `json:"status,omitempty"` +} + +// InferencePoolImport constructs a declarative configuration of the InferencePoolImport type for use with +// apply. +func InferencePoolImport(name, namespace string) *InferencePoolImportApplyConfiguration { + b := &InferencePoolImportApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("InferencePoolImport") + b.WithAPIVersion("inference.networking.x-k8s.io/v1alpha1") + return b +} +func (b InferencePoolImportApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithKind(value string) *InferencePoolImportApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithAPIVersion(value string) *InferencePoolImportApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithName(value string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithGenerateName(value string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithNamespace(value string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithUID(value types.UID) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithResourceVersion(value string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithGeneration(value int64) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InferencePoolImportApplyConfiguration) WithLabels(entries map[string]string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InferencePoolImportApplyConfiguration) WithAnnotations(entries map[string]string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InferencePoolImportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InferencePoolImportApplyConfiguration) WithFinalizers(values ...string) *InferencePoolImportApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InferencePoolImportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithSpec(value apixv1alpha1.InferencePoolImportSpec) *InferencePoolImportApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InferencePoolImportApplyConfiguration) WithStatus(value *InferencePoolImportStatusApplyConfiguration) *InferencePoolImportApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *InferencePoolImportApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *InferencePoolImportApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InferencePoolImportApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *InferencePoolImportApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimportstatus.go b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimportstatus.go new file mode 100644 index 000000000..9c2141481 --- /dev/null +++ b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimportstatus.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// InferencePoolImportStatusApplyConfiguration represents a declarative configuration of the InferencePoolImportStatus type for use +// with apply. +type InferencePoolImportStatusApplyConfiguration struct { + Controllers []ImportControllerApplyConfiguration `json:"controllers,omitempty"` +} + +// InferencePoolImportStatusApplyConfiguration constructs a declarative configuration of the InferencePoolImportStatus type for use with +// apply. +func InferencePoolImportStatus() *InferencePoolImportStatusApplyConfiguration { + return &InferencePoolImportStatusApplyConfiguration{} +} + +// WithControllers adds the given value to the Controllers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Controllers field. +func (b *InferencePoolImportStatusApplyConfiguration) WithControllers(values ...*ImportControllerApplyConfiguration) *InferencePoolImportStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithControllers") + } + b.Controllers = append(b.Controllers, *values[i]) + } + return b +} diff --git a/client-go/applyconfiguration/utils.go b/client-go/applyconfiguration/utils.go index 8e11c0082..7e4ea0915 100644 --- a/client-go/applyconfiguration/utils.go +++ b/client-go/applyconfiguration/utils.go @@ -23,8 +23,10 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + v1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" apiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha1" apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha2" internal "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/internal" ) @@ -51,6 +53,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case v1.SchemeGroupVersion.WithKind("Port"): return &apiv1.PortApplyConfiguration{} + // Group=inference.networking.x-k8s.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("ExportingCluster"): + return &apixv1alpha1.ExportingClusterApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ImportController"): + return &apixv1alpha1.ImportControllerApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("InferencePoolImport"): + return &apixv1alpha1.InferencePoolImportApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("InferencePoolImportStatus"): + return &apixv1alpha1.InferencePoolImportStatusApplyConfiguration{} + // Group=inference.networking.x-k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithKind("Extension"): return &apixv1alpha2.ExtensionApplyConfiguration{} diff --git a/client-go/clientset/versioned/clientset.go b/client-go/clientset/versioned/clientset.go index 928ab89f1..0ea4a00a2 100644 --- a/client-go/clientset/versioned/clientset.go +++ b/client-go/clientset/versioned/clientset.go @@ -26,12 +26,14 @@ import ( rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" inferencev1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1" + inferencev1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha1" xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" ) type Interface interface { Discovery() discovery.DiscoveryInterface InferenceV1() inferencev1.InferenceV1Interface + InferenceV1alpha1() inferencev1alpha1.InferenceV1alpha1Interface XInferenceV1alpha2() xinferencev1alpha2.XInferenceV1alpha2Interface } @@ -39,6 +41,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient inferenceV1 *inferencev1.InferenceV1Client + inferenceV1alpha1 *inferencev1alpha1.InferenceV1alpha1Client xInferenceV1alpha2 *xinferencev1alpha2.XInferenceV1alpha2Client } @@ -47,6 +50,11 @@ func (c *Clientset) InferenceV1() inferencev1.InferenceV1Interface { return c.inferenceV1 } +// InferenceV1alpha1 retrieves the InferenceV1alpha1Client +func (c *Clientset) InferenceV1alpha1() inferencev1alpha1.InferenceV1alpha1Interface { + return c.inferenceV1alpha1 +} + // XInferenceV1alpha2 retrieves the XInferenceV1alpha2Client func (c *Clientset) XInferenceV1alpha2() xinferencev1alpha2.XInferenceV1alpha2Interface { return c.xInferenceV1alpha2 @@ -100,6 +108,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.inferenceV1alpha1, err = inferencev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.xInferenceV1alpha2, err = xinferencev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -126,6 +138,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.inferenceV1 = inferencev1.New(c) + cs.inferenceV1alpha1 = inferencev1alpha1.New(c) cs.xInferenceV1alpha2 = xinferencev1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) diff --git a/client-go/clientset/versioned/fake/clientset_generated.go b/client-go/clientset/versioned/fake/clientset_generated.go index a0709d723..baa42d884 100644 --- a/client-go/clientset/versioned/fake/clientset_generated.go +++ b/client-go/clientset/versioned/fake/clientset_generated.go @@ -29,6 +29,8 @@ import ( clientset "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned" inferencev1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1" fakeinferencev1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1/fake" + inferencev1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha1" + fakeinferencev1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha1/fake" xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" fakexinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2/fake" ) @@ -132,6 +134,11 @@ func (c *Clientset) InferenceV1() inferencev1.InferenceV1Interface { return &fakeinferencev1.FakeInferenceV1{Fake: &c.Fake} } +// InferenceV1alpha1 retrieves the InferenceV1alpha1Client +func (c *Clientset) InferenceV1alpha1() inferencev1alpha1.InferenceV1alpha1Interface { + return &fakeinferencev1alpha1.FakeInferenceV1alpha1{Fake: &c.Fake} +} + // XInferenceV1alpha2 retrieves the XInferenceV1alpha2Client func (c *Clientset) XInferenceV1alpha2() xinferencev1alpha2.XInferenceV1alpha2Interface { return &fakexinferencev1alpha2.FakeXInferenceV1alpha2{Fake: &c.Fake} diff --git a/client-go/clientset/versioned/fake/register.go b/client-go/clientset/versioned/fake/register.go index 5c6d338ce..412308d9e 100644 --- a/client-go/clientset/versioned/fake/register.go +++ b/client-go/clientset/versioned/fake/register.go @@ -25,6 +25,7 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" inferencev1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + inferencev1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) @@ -33,6 +34,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ inferencev1.AddToScheme, + inferencev1alpha1.AddToScheme, xinferencev1alpha2.AddToScheme, } diff --git a/client-go/clientset/versioned/scheme/register.go b/client-go/clientset/versioned/scheme/register.go index 7836df4f5..47bdc7c33 100644 --- a/client-go/clientset/versioned/scheme/register.go +++ b/client-go/clientset/versioned/scheme/register.go @@ -25,6 +25,7 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" inferencev1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + inferencev1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) @@ -33,6 +34,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ inferencev1.AddToScheme, + inferencev1alpha1.AddToScheme, xinferencev1alpha2.AddToScheme, } diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/apix_client.go b/client-go/clientset/versioned/typed/apix/v1alpha1/apix_client.go new file mode 100644 index 000000000..726c4103b --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/apix_client.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + http "net/http" + + rest "k8s.io/client-go/rest" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" + scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" +) + +type InferenceV1alpha1Interface interface { + RESTClient() rest.Interface + InferencePoolImportsGetter +} + +// InferenceV1alpha1Client is used to interact with features provided by the inference.networking.x-k8s.io group. +type InferenceV1alpha1Client struct { + restClient rest.Interface +} + +func (c *InferenceV1alpha1Client) InferencePoolImports(namespace string) InferencePoolImportInterface { + return newInferencePoolImports(c, namespace) +} + +// NewForConfig creates a new InferenceV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*InferenceV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new InferenceV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*InferenceV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &InferenceV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new InferenceV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *InferenceV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new InferenceV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *InferenceV1alpha1Client { + return &InferenceV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := apixv1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *InferenceV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/doc.go b/client-go/clientset/versioned/typed/apix/v1alpha1/doc.go new file mode 100644 index 000000000..df51baa4d --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/fake/doc.go b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/doc.go new file mode 100644 index 000000000..16f443990 --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_apix_client.go b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_apix_client.go new file mode 100644 index 000000000..1de7688eb --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_apix_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha1" +) + +type FakeInferenceV1alpha1 struct { + *testing.Fake +} + +func (c *FakeInferenceV1alpha1) InferencePoolImports(namespace string) v1alpha1.InferencePoolImportInterface { + return newFakeInferencePoolImports(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeInferenceV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_inferencepoolimport.go b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_inferencepoolimport.go new file mode 100644 index 000000000..7a6938f9d --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/fake/fake_inferencepoolimport.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha1" + typedapixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha1" +) + +// fakeInferencePoolImports implements InferencePoolImportInterface +type fakeInferencePoolImports struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.InferencePoolImport, *v1alpha1.InferencePoolImportList, *apixv1alpha1.InferencePoolImportApplyConfiguration] + Fake *FakeInferenceV1alpha1 +} + +func newFakeInferencePoolImports(fake *FakeInferenceV1alpha1, namespace string) typedapixv1alpha1.InferencePoolImportInterface { + return &fakeInferencePoolImports{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.InferencePoolImport, *v1alpha1.InferencePoolImportList, *apixv1alpha1.InferencePoolImportApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("inferencepoolimports"), + v1alpha1.SchemeGroupVersion.WithKind("InferencePoolImport"), + func() *v1alpha1.InferencePoolImport { return &v1alpha1.InferencePoolImport{} }, + func() *v1alpha1.InferencePoolImportList { return &v1alpha1.InferencePoolImportList{} }, + func(dst, src *v1alpha1.InferencePoolImportList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.InferencePoolImportList) []*v1alpha1.InferencePoolImport { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.InferencePoolImportList, items []*v1alpha1.InferencePoolImport) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/generated_expansion.go b/client-go/clientset/versioned/typed/apix/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..0969f5b0c --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type InferencePoolImportExpansion interface{} diff --git a/client-go/clientset/versioned/typed/apix/v1alpha1/inferencepoolimport.go b/client-go/clientset/versioned/typed/apix/v1alpha1/inferencepoolimport.go new file mode 100644 index 000000000..f68766d9a --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha1/inferencepoolimport.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" + applyconfigurationapixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha1" + scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" +) + +// InferencePoolImportsGetter has a method to return a InferencePoolImportInterface. +// A group's client should implement this interface. +type InferencePoolImportsGetter interface { + InferencePoolImports(namespace string) InferencePoolImportInterface +} + +// InferencePoolImportInterface has methods to work with InferencePoolImport resources. +type InferencePoolImportInterface interface { + Create(ctx context.Context, inferencePoolImport *apixv1alpha1.InferencePoolImport, opts v1.CreateOptions) (*apixv1alpha1.InferencePoolImport, error) + Update(ctx context.Context, inferencePoolImport *apixv1alpha1.InferencePoolImport, opts v1.UpdateOptions) (*apixv1alpha1.InferencePoolImport, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inferencePoolImport *apixv1alpha1.InferencePoolImport, opts v1.UpdateOptions) (*apixv1alpha1.InferencePoolImport, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apixv1alpha1.InferencePoolImport, error) + List(ctx context.Context, opts v1.ListOptions) (*apixv1alpha1.InferencePoolImportList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apixv1alpha1.InferencePoolImport, err error) + Apply(ctx context.Context, inferencePoolImport *applyconfigurationapixv1alpha1.InferencePoolImportApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha1.InferencePoolImport, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inferencePoolImport *applyconfigurationapixv1alpha1.InferencePoolImportApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha1.InferencePoolImport, err error) + InferencePoolImportExpansion +} + +// inferencePoolImports implements InferencePoolImportInterface +type inferencePoolImports struct { + *gentype.ClientWithListAndApply[*apixv1alpha1.InferencePoolImport, *apixv1alpha1.InferencePoolImportList, *applyconfigurationapixv1alpha1.InferencePoolImportApplyConfiguration] +} + +// newInferencePoolImports returns a InferencePoolImports +func newInferencePoolImports(c *InferenceV1alpha1Client, namespace string) *inferencePoolImports { + return &inferencePoolImports{ + gentype.NewClientWithListAndApply[*apixv1alpha1.InferencePoolImport, *apixv1alpha1.InferencePoolImportList, *applyconfigurationapixv1alpha1.InferencePoolImportApplyConfiguration]( + "inferencepoolimports", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apixv1alpha1.InferencePoolImport { return &apixv1alpha1.InferencePoolImport{} }, + func() *apixv1alpha1.InferencePoolImportList { return &apixv1alpha1.InferencePoolImportList{} }, + ), + } +} diff --git a/client-go/informers/externalversions/apix/interface.go b/client-go/informers/externalversions/apix/interface.go index 26e18173f..426cbcdd9 100644 --- a/client-go/informers/externalversions/apix/interface.go +++ b/client-go/informers/externalversions/apix/interface.go @@ -19,12 +19,15 @@ limitations under the License. package apix import ( + v1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/apix/v1alpha1" v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/apix/v1alpha2" internalinterfaces "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface // V1alpha2 provides access to shared informers for resources in V1alpha2. V1alpha2() v1alpha2.Interface } @@ -40,6 +43,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1alpha2 returns a new v1alpha2.Interface. func (g *group) V1alpha2() v1alpha2.Interface { return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/client-go/informers/externalversions/apix/v1alpha1/inferencepoolimport.go b/client-go/informers/externalversions/apix/v1alpha1/inferencepoolimport.go new file mode 100644 index 000000000..9013e02a5 --- /dev/null +++ b/client-go/informers/externalversions/apix/v1alpha1/inferencepoolimport.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + gatewayapiinferenceextensionapixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" + versioned "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned" + internalinterfaces "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/internalinterfaces" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/apix/v1alpha1" +) + +// InferencePoolImportInformer provides access to a shared informer and lister for +// InferencePoolImports. +type InferencePoolImportInformer interface { + Informer() cache.SharedIndexInformer + Lister() apixv1alpha1.InferencePoolImportLister +} + +type inferencePoolImportInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewInferencePoolImportInformer constructs a new informer for InferencePoolImport type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInferencePoolImportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInferencePoolImportInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredInferencePoolImportInformer constructs a new informer for InferencePoolImport type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInferencePoolImportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1alpha1().InferencePoolImports(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1alpha1().InferencePoolImports(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1alpha1().InferencePoolImports(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1alpha1().InferencePoolImports(namespace).Watch(ctx, options) + }, + }, + &gatewayapiinferenceextensionapixv1alpha1.InferencePoolImport{}, + resyncPeriod, + indexers, + ) +} + +func (f *inferencePoolImportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInferencePoolImportInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inferencePoolImportInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiinferenceextensionapixv1alpha1.InferencePoolImport{}, f.defaultInformer) +} + +func (f *inferencePoolImportInformer) Lister() apixv1alpha1.InferencePoolImportLister { + return apixv1alpha1.NewInferencePoolImportLister(f.Informer().GetIndexer()) +} diff --git a/client-go/informers/externalversions/apix/v1alpha1/interface.go b/client-go/informers/externalversions/apix/v1alpha1/interface.go new file mode 100644 index 000000000..50e84d5b1 --- /dev/null +++ b/client-go/informers/externalversions/apix/v1alpha1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // InferencePoolImports returns a InferencePoolImportInformer. + InferencePoolImports() InferencePoolImportInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InferencePoolImports returns a InferencePoolImportInformer. +func (v *version) InferencePoolImports() InferencePoolImportInformer { + return &inferencePoolImportInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/client-go/informers/externalversions/generic.go b/client-go/informers/externalversions/generic.go index 03c95ee05..2fe29156b 100644 --- a/client-go/informers/externalversions/generic.go +++ b/client-go/informers/externalversions/generic.go @@ -24,6 +24,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + v1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) @@ -57,6 +58,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1.SchemeGroupVersion.WithResource("inferencepools"): return &genericInformer{resource: resource.GroupResource(), informer: f.Inference().V1().InferencePools().Informer()}, nil + // Group=inference.networking.x-k8s.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("inferencepoolimports"): + return &genericInformer{resource: resource.GroupResource(), informer: f.XInference().V1alpha1().InferencePoolImports().Informer()}, nil + // Group=inference.networking.x-k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithResource("inferenceobjectives"): return &genericInformer{resource: resource.GroupResource(), informer: f.XInference().V1alpha2().InferenceObjectives().Informer()}, nil diff --git a/client-go/listers/apix/v1alpha1/expansion_generated.go b/client-go/listers/apix/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..7c0d32cbb --- /dev/null +++ b/client-go/listers/apix/v1alpha1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// InferencePoolImportListerExpansion allows custom methods to be added to +// InferencePoolImportLister. +type InferencePoolImportListerExpansion interface{} + +// InferencePoolImportNamespaceListerExpansion allows custom methods to be added to +// InferencePoolImportNamespaceLister. +type InferencePoolImportNamespaceListerExpansion interface{} diff --git a/client-go/listers/apix/v1alpha1/inferencepoolimport.go b/client-go/listers/apix/v1alpha1/inferencepoolimport.go new file mode 100644 index 000000000..653bbfa45 --- /dev/null +++ b/client-go/listers/apix/v1alpha1/inferencepoolimport.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" +) + +// InferencePoolImportLister helps list InferencePoolImports. +// All objects returned here must be treated as read-only. +type InferencePoolImportLister interface { + // List lists all InferencePoolImports in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apixv1alpha1.InferencePoolImport, err error) + // InferencePoolImports returns an object that can list and get InferencePoolImports. + InferencePoolImports(namespace string) InferencePoolImportNamespaceLister + InferencePoolImportListerExpansion +} + +// inferencePoolImportLister implements the InferencePoolImportLister interface. +type inferencePoolImportLister struct { + listers.ResourceIndexer[*apixv1alpha1.InferencePoolImport] +} + +// NewInferencePoolImportLister returns a new InferencePoolImportLister. +func NewInferencePoolImportLister(indexer cache.Indexer) InferencePoolImportLister { + return &inferencePoolImportLister{listers.New[*apixv1alpha1.InferencePoolImport](indexer, apixv1alpha1.Resource("inferencepoolimport"))} +} + +// InferencePoolImports returns an object that can list and get InferencePoolImports. +func (s *inferencePoolImportLister) InferencePoolImports(namespace string) InferencePoolImportNamespaceLister { + return inferencePoolImportNamespaceLister{listers.NewNamespaced[*apixv1alpha1.InferencePoolImport](s.ResourceIndexer, namespace)} +} + +// InferencePoolImportNamespaceLister helps list and get InferencePoolImports. +// All objects returned here must be treated as read-only. +type InferencePoolImportNamespaceLister interface { + // List lists all InferencePoolImports in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apixv1alpha1.InferencePoolImport, err error) + // Get retrieves the InferencePoolImport from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apixv1alpha1.InferencePoolImport, error) + InferencePoolImportNamespaceListerExpansion +} + +// inferencePoolImportNamespaceLister implements the InferencePoolImportNamespaceLister +// interface. +type inferencePoolImportNamespaceLister struct { + listers.ResourceIndexer[*apixv1alpha1.InferencePoolImport] +} diff --git a/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml b/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml index 2ccaf2306..f1dc4226e 100644 --- a/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml +++ b/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml @@ -271,6 +271,25 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + controllerName: + description: |- + ControllerName is a domain/path string that indicates the name of the controller that + wrote this status. This corresponds with the GatewayClass controllerName field when the + parentRef references a Gateway kind. + + Example: "example.net/gateway-controller". + + The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names: + + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + Controllers MUST populate this field when writing status. Controllers should ensure that + entries to status populated with their ControllerName are cleaned up when they are no + longer necessary. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$ + type: string parentRef: description: |- ParentRef is used to identify the parent resource that this status @@ -317,6 +336,7 @@ spec: - name type: object required: + - controllerName - parentRef type: object maxItems: 32 diff --git a/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml b/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml new file mode 100644 index 000000000..e36987e7a --- /dev/null +++ b/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml @@ -0,0 +1,334 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + inference.networking.k8s.io/bundle-version: main-dev + name: inferencepoolimports.inference.networking.x-k8s.io +spec: + group: inference.networking.x-k8s.io + names: + kind: InferencePoolImport + listKind: InferencePoolImportList + plural: inferencepoolimports + shortNames: + - infpimp + singular: inferencepoolimport + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: InferencePoolImport is the Schema for the InferencePoolImports + API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of the InferencePoolImport. + type: object + status: + description: Status defines the observed state of the InferencePoolImport. + properties: + controllers: + description: Controllers is a list of controllers that are responsible + for managing the InferencePoolImport. + items: + description: ImportController defines a controller that is responsible + for managing the InferencePoolImport. + properties: + conditions: + description: |- + Conditions track the state of the InferencePoolImport. + + Known condition types are: + + * "Accepted" + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 8 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + exportingClusters: + description: |- + ExportingClusters is a list of clusters that exported the InferencePool(s) that back the + InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport + from the exported InferencePool(s). + items: + description: ExportingCluster defines a cluster that exported + the InferencePool associated to this InferencePoolImport. + properties: + name: + description: Name of the exporting cluster (must be unique + within the list). + type: string + required: + - name + type: object + type: array + name: + description: |- + Name is a domain/path string that indicates the name of the controller that manages the + InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the + controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific. + + Example: "example.net/import-controller". + + The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes + names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). + + A controller MUST populate this field when writing status and ensure that entries to status + populated with their controller name are removed when they are no longer necessary. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$ + type: string + parents: + description: |- + Parents is a list of parent resources, typically Gateways, that are associated with the + InferencePoolImport, and the status of the InferencePoolImport with respect to each parent. + + Ancestor would be a more accurate name, but Parent is consistent with InferencePool terminology. + + Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller + must add an entry for each parent it manages and remove the parent entry when the controller no longer + considers the InferencePoolImport to be associated with that parent. + items: + description: ParentStatus defines the observed state of InferencePool + from a Parent, i.e. Gateway. + properties: + conditions: + description: |- + Conditions is a list of status conditions that provide information about the observed + state of the InferencePool. This field is required to be set by the controller that + manages the InferencePool. + + Supported condition types are: + + * "Accepted" + * "ResolvedRefs" + items: + description: Condition contains details for one aspect + of the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, + False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in + foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 8 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controllerName: + description: |- + ControllerName is a domain/path string that indicates the name of the controller that + wrote this status. This corresponds with the GatewayClass controllerName field when the + parentRef references a Gateway kind. + + Example: "example.net/gateway-controller". + + The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names: + + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + Controllers MUST populate this field when writing status. Controllers should ensure that + entries to status populated with their ControllerName are cleaned up when they are no + longer necessary. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$ + type: string + parentRef: + description: |- + ParentRef is used to identify the parent resource that this status + is associated with. It is used to match the InferencePool with the parent + resource, such as a Gateway. + properties: + group: + default: gateway.networking.k8s.io + description: |- + Group is the group of the referent API object. When unspecified, the referent is assumed + to be in the "gateway.networking.k8s.io" API group. + maxLength: 253 + minLength: 0 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + default: Gateway + description: |- + Kind is the kind of the referent API object. When unspecified, the referent is assumed + to be a "Gateway" kind. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the referent API + object. + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + Namespace is the namespace of the referenced object. When unspecified, the local + namespace is inferred. + + Note that when a namespace different than the local namespace is specified, + a ReferenceGrant object is required in the referent namespace to allow that + namespace's owner to accept the reference. See the ReferenceGrant + documentation for details: https://gateway-api.sigs.k8s.io/api-types/referencegrant/ + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - name + type: object + required: + - controllerName + - parentRef + type: object + type: array + x-kubernetes-list-type: atomic + required: + - name + type: object + maxItems: 8 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - controllers + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/crd-ref-docs.yaml b/crd-ref-docs.yaml index d00e6d09b..5fefbffd6 100644 --- a/crd-ref-docs.yaml +++ b/crd-ref-docs.yaml @@ -4,7 +4,7 @@ processor: ignoreTypes: - - "(InferencePool|InferenceObjective)List$" + - "(InferencePool|InferenceObjective|InferencePoolImport)List$" # RE2 regular expressions describing type fields that should be excluded from the generated documentation. ignoreFields: - "TypeMeta$" diff --git a/mkdocs.yml b/mkdocs.yml index b746f743d..4c285c2e8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -82,11 +82,15 @@ nav: - Benchmark: performance/benchmark/index.md - Regression Testing: performance/regression-testing/index.md - Reference: - - API Reference: reference/spec.md - - Alpha API Reference: reference/x-spec.md + - v1 API Reference: reference/spec.md + - v1alpha1 API Reference: + - reference/x-v1a1-spec.md + - v1alpha2 API Reference: + - reference/x-v1a2-spec.md - API Types: - InferencePool: api-types/inferencepool.md - InferenceObjective: api-types/inferenceobjective.md + - InferencePoolImport: api-types/inferencepoolimport.md - Enhancements: - Overview: enhancements/overview.md - Contributing: diff --git a/pkg/generator/main.go b/pkg/generator/main.go index 3cb70a508..c663588a9 100644 --- a/pkg/generator/main.go +++ b/pkg/generator/main.go @@ -35,6 +35,7 @@ import ( func main() { roots, err := loader.LoadRoots( "k8s.io/apimachinery/pkg/runtime/schema", // Needed to parse generated register functions. + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1", "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2", "sigs.k8s.io/gateway-api-inference-extension/api/v1", ) diff --git a/site-src/api-types/inferenceobjective.md b/site-src/api-types/inferenceobjective.md index 4ce6a7ccd..8c48651d6 100644 --- a/site-src/api-types/inferenceobjective.md +++ b/site-src/api-types/inferenceobjective.md @@ -15,4 +15,4 @@ To associate a request to the InferencePool with a specific InferenceObjective, ## Spec -The full spec of the InferenceObjective is defined [here](/reference/x-spec/#inferenceobjective). \ No newline at end of file +The full spec of the InferenceObjective is defined [here](/reference/x-v1-a2-spec/#inferenceobjective). diff --git a/site-src/api-types/inferencepoolimport.md b/site-src/api-types/inferencepoolimport.md new file mode 100644 index 000000000..aa58247b2 --- /dev/null +++ b/site-src/api-types/inferencepoolimport.md @@ -0,0 +1,26 @@ +# Inference Pool Import + +??? example "Alpha since v1.1.0" + + The `InferencePoolImport` resource is alpha and may have breaking changes in + future releases of the API. + +## Background + +The **InferencePoolImport** API is a cluster-local, controller-managed resource that represents an imported InferencePool. +It primarily communicates a relationship between an exported InferencePool and the exporting cluster name. It is not +user-authored; status carries the effective import. Inference Platform Owners can reference the InferencePoolImport, +even if the local cluster does not have an InferencePool. In the context of Gateway API, it means that an HTTPRoute can +be configured to reference an InferencePoolImport to route matching requests to endpoints of backing InferencePools. + +Key ideas: + +- Map an exported InferencePool to exporting controller and cluster. +- Name/namespace sameness with the exported InferencePool (avoids extra indirection). +- Conditions: Surface a controller-level status condition to indicate whether the InferencePoolImport is ready for use. +- Conditions: Surface parent-level status conditions to indicate whether the InferencePoolImport is referenced by a parent, + e.g. Gateway. + +## Spec + +The full spec of the InferencePoolImport is defined [here](/reference/x-v1a1-spec/#inferencepoolimport). diff --git a/site-src/reference/spec.md b/site-src/reference/spec.md index 11080fe24..661b5e6f4 100644 --- a/site-src/reference/spec.md +++ b/site-src/reference/spec.md @@ -294,6 +294,32 @@ _Appears in:_ +#### ParentController + +_Underlying type:_ _string_ + +ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed +path. + +Valid values include: + +* "example.com/bar" + +Invalid values include: + +* "example.com" - must include path +* "foo.example.com" - must include path + +_Validation:_ +- MaxLength: 253 +- MinLength: 1 +- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` + +_Appears in:_ +- [ParentStatus](#parentstatus) + + + #### ParentReference @@ -329,6 +355,7 @@ _Appears in:_ | --- | --- | --- | --- | | `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | Conditions is a list of status conditions that provide information about the observed
state of the InferencePool. This field is required to be set by the controller that
manages the InferencePool.
Supported condition types are:
* "Accepted"
* "ResolvedRefs" | | MaxItems: 8
| | `parentRef` _[ParentReference](#parentreference)_ | ParentRef is used to identify the parent resource that this status
is associated with. It is used to match the InferencePool with the parent
resource, such as a Gateway. | | | +| `controllerName` _[ParentController](#parentcontroller)_ | ControllerName is a domain/path string that indicates the name of the controller that
wrote this status. This corresponds with the GatewayClass controllerName field when the
parentRef references a Gateway kind.
Example: "example.net/gateway-controller".
The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Controllers MUST populate this field when writing status. Controllers should ensure that
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary. | | MaxLength: 253
MinLength: 1
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
| #### Port diff --git a/site-src/reference/x-v1a1-spec.md b/site-src/reference/x-v1a1-spec.md new file mode 100644 index 000000000..338caa47d --- /dev/null +++ b/site-src/reference/x-v1a1-spec.md @@ -0,0 +1,125 @@ +# API Reference + +## Packages +- [inference.networking.x-k8s.io/v1alpha1](#inferencenetworkingx-k8siov1alpha1) + + +## inference.networking.x-k8s.io/v1alpha1 + +Package v1alpha1 contains API Schema definitions for the +inference.networking.x-k8s.io API group. + + +### Resource Types +- [InferencePoolImport](#inferencepoolimport) + + + +#### ControllerName + +_Underlying type:_ _string_ + +ControllerName is the name of a controller that manages a resource. It must be a domain prefixed path. + +Valid values include: + + * "example.com/bar" + +Invalid values include: + + * "example.com" - must include path + * "foo.example.com" - must include path + +_Validation:_ +- MaxLength: 253 +- MinLength: 1 +- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` + +_Appears in:_ +- [ImportController](#importcontroller) + + + +#### ExportingCluster + + + +ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport. + + + +_Appears in:_ +- [ImportController](#importcontroller) + +| Field | Description | Default | Validation | +| --- | --- | --- | --- | +| `name` _string_ | Name of the exporting cluster (must be unique within the list). | | Required: \{\}
| + + +#### ImportController + + + +ImportController defines a controller that is responsible for managing the InferencePoolImport. + + + +_Appears in:_ +- [InferencePoolImportStatus](#inferencepoolimportstatus) + +| Field | Description | Default | Validation | +| --- | --- | --- | --- | +| `name` _[ControllerName](#controllername)_ | Name is a domain/path string that indicates the name of the controller that manages the
InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the
controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific.
Example: "example.net/import-controller".
The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes
names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
A controller MUST populate this field when writing status and ensure that entries to status
populated with their controller name are removed when they are no longer necessary. | | MaxLength: 253
MinLength: 1
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
| +| `exportingClusters` _[ExportingCluster](#exportingcluster) array_ | ExportingClusters is a list of clusters that exported the InferencePool(s) that back the
InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport
from the exported InferencePool(s). | | | +| `parents` _ParentStatus array_ | Parents is a list of parent resources, typically Gateways, that are associated with the
InferencePoolImport, and the status of the InferencePoolImport with respect to each parent.
Ancestor would be a more accurate name, but Parent is consistent with InferencePool terminology.
Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller
must add an entry for each parent it manages and remove the parent entry when the controller no longer
considers the InferencePoolImport to be associated with that parent. | | | +| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | Conditions track the state of the InferencePoolImport.
Known condition types are:
* "Accepted" | | MaxItems: 8
| + + +#### InferencePoolImport + + + +InferencePoolImport is the Schema for the InferencePoolImports API. + + + + + +| Field | Description | Default | Validation | +| --- | --- | --- | --- | +| `apiVersion` _string_ | `inference.networking.x-k8s.io/v1alpha1` | | | +| `kind` _string_ | `InferencePoolImport` | | | +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | +| `spec` _[InferencePoolImportSpec](#inferencepoolimportspec)_ | Spec defines the desired state of the InferencePoolImport. | | | +| `status` _[InferencePoolImportStatus](#inferencepoolimportstatus)_ | Status defines the observed state of the InferencePoolImport. | | | + + +#### InferencePoolImportSpec + + + +InferencePoolImportSpec defines the desired state of the InferencePoolImport. + + + +_Appears in:_ +- [InferencePoolImport](#inferencepoolimport) + + + +#### InferencePoolImportStatus + + + +InferencePoolImportStatus defines the observed state of the InferencePoolImport. + + + +_Appears in:_ +- [InferencePoolImport](#inferencepoolimport) + +| Field | Description | Default | Validation | +| --- | --- | --- | --- | +| `controllers` _[ImportController](#importcontroller) array_ | Controllers is a list of controllers that are responsible for managing the InferencePoolImport. | | MaxItems: 8
Required: \{\}
| + + diff --git a/site-src/reference/x-spec.md b/site-src/reference/x-v1a2-spec.md similarity index 100% rename from site-src/reference/x-spec.md rename to site-src/reference/x-v1a2-spec.md From dbe103f85145b7a4595d879dad44678bc5573c4d Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Mon, 29 Sep 2025 11:53:22 -0700 Subject: [PATCH 2/2] Resolves initial review comments Signed-off-by: Daneyon Hansen --- api/v1/inferencepool_types.go | 23 ++-- apix/v1alpha1/inferencepoolimport_types.go | 128 +++++++++--------- apix/v1alpha1/zz_generated.deepcopy.go | 16 --- .../applyconfiguration/api/v1/parentstatus.go | 4 +- .../apix/v1alpha1/exportingcluster.go | 8 +- .../apix/v1alpha1/inferencepoolimport.go | 10 -- ...working.x-k8s.io_inferencepoolimports.yaml | 9 +- site-src/reference/spec.md | 56 ++++---- site-src/reference/x-v1a1-spec.md | 33 ++--- 9 files changed, 134 insertions(+), 153 deletions(-) diff --git a/api/v1/inferencepool_types.go b/api/v1/inferencepool_types.go index 4efac08f6..caa2aef6b 100644 --- a/api/v1/inferencepool_types.go +++ b/api/v1/inferencepool_types.go @@ -218,10 +218,11 @@ type ParentStatus struct { // longer necessary. // // +required - ControllerName ParentController `json:"controllerName"` + //nolint:kubeapilinter // should not have omitempty since the field is required + ControllerName ControllerName `json:"controllerName"` } -// ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed +// ControllerName is the name of a controller that manages ParentStatus. It must be a domain prefixed // path. // // Valid values include: @@ -236,7 +237,7 @@ type ParentStatus struct { // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` -type ParentController string +type ControllerName string // InferencePoolConditionType is a type of status condition for the InferencePool. type InferencePoolConditionType string @@ -318,7 +319,8 @@ const ( // // Possible reasons for this condition to be False are: // - // * "Invalid" + // * "NotRequested" + // * "NotSupported" // // Controllers MAY raise this condition with other reasons, but should // prefer to use the reasons listed above to improve interoperability. @@ -328,10 +330,15 @@ const ( // condition is true. InferencePoolReasonExported InferencePoolReason = "Exported" - // InferencePoolReasonInvalid is a reason used with the "Exported" condition when the - // InferencePool cannot be exported for some reason. A controller should provide - // additional information in the condition message. - InferencePoolReasonInvalid InferencePoolReason = "Invalid" + // InferencePoolReasonNotRequested is a reason used with the "Exported" condition when the + // condition is false and no export was requested by the InferencePool. This indicates a + // deliberate non-action rather than an error. + InferencePoolReasonNotRequested InferencePoolReason = "NotRequested" + + // InferencePoolReasonNotSupported is a reason used with the "Exported" condition when the + // condition is false and the export was requested but is not supported by the implementation. + // Controllers should include details in the condition message. + InferencePoolReasonNotSupported InferencePoolReason = "NotSupported" ) // ParentReference identifies an API object. It is used to associate the InferencePool with a diff --git a/apix/v1alpha1/inferencepoolimport_types.go b/apix/v1alpha1/inferencepoolimport_types.go index 55d5460b0..2239aa3d0 100644 --- a/apix/v1alpha1/inferencepoolimport_types.go +++ b/apix/v1alpha1/inferencepoolimport_types.go @@ -35,11 +35,6 @@ type InferencePoolImport struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec defines the desired state of the InferencePoolImport. - // - // +required - Spec InferencePoolImportSpec `json:"spec,omitzero"` - // Status defines the observed state of the InferencePoolImport. // // +optional @@ -56,90 +51,93 @@ type InferencePoolImportList struct { Items []InferencePoolImport `json:"items"` } -// InferencePoolImportSpec defines the desired state of the InferencePoolImport. -type InferencePoolImportSpec struct {} - // InferencePoolImportStatus defines the observed state of the InferencePoolImport. type InferencePoolImportStatus struct { - // Controllers is a list of controllers that are responsible for managing the InferencePoolImport. - // + // Controllers is a list of controllers that are responsible for managing the InferencePoolImport. + // // +listType=map // +listMapKey=name - // +kubebuilder:validation:MaxItems=8 - // +kubebuilder:validation:Required - Controllers []ImportController `json:"controllers"` + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:validation:Required + Controllers []ImportController `json:"controllers"` } // ImportController defines a controller that is responsible for managing the InferencePoolImport. type ImportController struct { - // Name is a domain/path string that indicates the name of the controller that manages the - // InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the - // controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific. - // - // Example: "example.net/import-controller". - // - // The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes - // names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - // - // A controller MUST populate this field when writing status and ensure that entries to status - // populated with their controller name are removed when they are no longer necessary. - // - // +required - Name ControllerName `json:"name"` - - // ExportingClusters is a list of clusters that exported the InferencePool(s) that back the - // InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport - // from the exported InferencePool(s). - // - // +optional - ExportingClusters []ExportingCluster `json:"exportingClusters,omitempty"` - - // Parents is a list of parent resources, typically Gateways, that are associated with the - // InferencePoolImport, and the status of the InferencePoolImport with respect to each parent. + // Name is a domain/path string that indicates the name of the controller that manages the + // InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the + // controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific. + // + // Example: "example.net/import-controller". + // + // The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes + // names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). + // + // A controller MUST populate this field when writing status and ensure that entries to status + // populated with their controller name are removed when they are no longer necessary. + // + // +required + Name ControllerName `json:"name"` + + // ExportingClusters is a list of clusters that exported the InferencePool(s) that back the + // InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport + // from the exported InferencePool(s). + // + // +optional + ExportingClusters []ExportingCluster `json:"exportingClusters,omitempty"` + + // Parents is a list of parent resources, typically Gateways, that are associated with the + // InferencePoolImport, and the status of the InferencePoolImport with respect to each parent. // // Ancestor would be a more accurate name, but Parent is consistent with InferencePool terminology. - // - // Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller - // must add an entry for each parent it manages and remove the parent entry when the controller no longer - // considers the InferencePoolImport to be associated with that parent. - // - // +optional - // +listType=atomic - Parents []v1.ParentStatus `json:"parents,omitempty"` - - // Conditions track the state of the InferencePoolImport. - // - // Known condition types are: - // - // * "Accepted" - // - // +optional - // +listType=map - // +listMapKey=type - // +kubebuilder:validation:MaxItems=8 - Conditions []metav1.Condition `json:"conditions,omitempty"` + // + // Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller + // must add an entry for each parent it manages and remove the parent entry when the controller no longer + // considers the InferencePoolImport to be associated with that parent. + // + // +optional + // +listType=atomic + Parents []v1.ParentStatus `json:"parents,omitempty"` + + // Conditions track the state of the InferencePoolImport. + // + // Known condition types are: + // + // * "Accepted" + // + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=8 + Conditions []metav1.Condition `json:"conditions,omitempty"` } // ControllerName is the name of a controller that manages a resource. It must be a domain prefixed path. // // Valid values include: // -// * "example.com/bar" +// - "example.com/bar" // // Invalid values include: // -// * "example.com" - must include path -// * "foo.example.com" - must include path +// - "example.com" - must include path +// - "foo.example.com" - must include path // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` type ControllerName string -// ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport. +// ClusterName is the name of a cluster that exported the InferencePool. +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +type ClusterName string + +// ExportingCluster defines a cluster that exported the InferencePool that backs this InferencePoolImport. type ExportingCluster struct { - // Name of the exporting cluster (must be unique within the list). - // - // +kubebuilder:validation:Required - Name string `json:"name"` + // Name of the exporting cluster (must be unique within the list). + // + // +kubebuilder:validation:Required + Name ClusterName `json:"name"` } diff --git a/apix/v1alpha1/zz_generated.deepcopy.go b/apix/v1alpha1/zz_generated.deepcopy.go index 4a8cd78e4..f6f182616 100644 --- a/apix/v1alpha1/zz_generated.deepcopy.go +++ b/apix/v1alpha1/zz_generated.deepcopy.go @@ -80,7 +80,6 @@ func (in *InferencePoolImport) DeepCopyInto(out *InferencePoolImport) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) } @@ -134,21 +133,6 @@ func (in *InferencePoolImportList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InferencePoolImportSpec) DeepCopyInto(out *InferencePoolImportSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolImportSpec. -func (in *InferencePoolImportSpec) DeepCopy() *InferencePoolImportSpec { - if in == nil { - return nil - } - out := new(InferencePoolImportSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InferencePoolImportStatus) DeepCopyInto(out *InferencePoolImportStatus) { *out = *in diff --git a/client-go/applyconfiguration/api/v1/parentstatus.go b/client-go/applyconfiguration/api/v1/parentstatus.go index b8940e204..929df5815 100644 --- a/client-go/applyconfiguration/api/v1/parentstatus.go +++ b/client-go/applyconfiguration/api/v1/parentstatus.go @@ -28,7 +28,7 @@ import ( type ParentStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` - ControllerName *apiv1.ParentController `json:"controllerName,omitempty"` + ControllerName *apiv1.ControllerName `json:"controllerName,omitempty"` } // ParentStatusApplyConfiguration constructs a declarative configuration of the ParentStatus type for use with @@ -61,7 +61,7 @@ func (b *ParentStatusApplyConfiguration) WithParentRef(value *ParentReferenceApp // WithControllerName sets the ControllerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ControllerName field is set to the value of the last call. -func (b *ParentStatusApplyConfiguration) WithControllerName(value apiv1.ParentController) *ParentStatusApplyConfiguration { +func (b *ParentStatusApplyConfiguration) WithControllerName(value apiv1.ControllerName) *ParentStatusApplyConfiguration { b.ControllerName = &value return b } diff --git a/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go b/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go index cc8d8455b..d1b2db058 100644 --- a/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go +++ b/client-go/applyconfiguration/apix/v1alpha1/exportingcluster.go @@ -18,10 +18,14 @@ limitations under the License. package v1alpha1 +import ( + apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" +) + // ExportingClusterApplyConfiguration represents a declarative configuration of the ExportingCluster type for use // with apply. type ExportingClusterApplyConfiguration struct { - Name *string `json:"name,omitempty"` + Name *apixv1alpha1.ClusterName `json:"name,omitempty"` } // ExportingClusterApplyConfiguration constructs a declarative configuration of the ExportingCluster type for use with @@ -33,7 +37,7 @@ func ExportingCluster() *ExportingClusterApplyConfiguration { // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *ExportingClusterApplyConfiguration) WithName(value string) *ExportingClusterApplyConfiguration { +func (b *ExportingClusterApplyConfiguration) WithName(value apixv1alpha1.ClusterName) *ExportingClusterApplyConfiguration { b.Name = &value return b } diff --git a/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go index 9e4adfd7d..f29c03845 100644 --- a/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go +++ b/client-go/applyconfiguration/apix/v1alpha1/inferencepoolimport.go @@ -22,7 +22,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1" ) // InferencePoolImportApplyConfiguration represents a declarative configuration of the InferencePoolImport type for use @@ -30,7 +29,6 @@ import ( type InferencePoolImportApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *apixv1alpha1.InferencePoolImportSpec `json:"spec,omitempty"` Status *InferencePoolImportStatusApplyConfiguration `json:"status,omitempty"` } @@ -204,14 +202,6 @@ func (b *InferencePoolImportApplyConfiguration) ensureObjectMetaApplyConfigurati } } -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *InferencePoolImportApplyConfiguration) WithSpec(value apixv1alpha1.InferencePoolImportSpec) *InferencePoolImportApplyConfiguration { - b.Spec = &value - return b -} - // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. diff --git a/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml b/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml index e36987e7a..16bfe1d45 100644 --- a/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml +++ b/config/crd/bases/inference.networking.x-k8s.io_inferencepoolimports.yaml @@ -38,9 +38,6 @@ spec: type: string metadata: type: object - spec: - description: Spec defines the desired state of the InferencePoolImport. - type: object status: description: Status defines the observed state of the InferencePoolImport. properties: @@ -125,11 +122,13 @@ spec: from the exported InferencePool(s). items: description: ExportingCluster defines a cluster that exported - the InferencePool associated to this InferencePoolImport. + the InferencePool that backs this InferencePoolImport. properties: name: description: Name of the exporting cluster (must be unique within the list). + maxLength: 253 + minLength: 1 type: string required: - name @@ -319,8 +318,6 @@ spec: required: - controllers type: object - required: - - spec type: object served: true storage: true diff --git a/site-src/reference/spec.md b/site-src/reference/spec.md index 661b5e6f4..5ef1b22ba 100644 --- a/site-src/reference/spec.md +++ b/site-src/reference/spec.md @@ -15,6 +15,32 @@ inference.networking.k8s.io API group. +#### ControllerName + +_Underlying type:_ _string_ + +ControllerName is the name of a controller that manages ParentStatus. It must be a domain prefixed +path. + +Valid values include: + +* "example.com/bar" + +Invalid values include: + +* "example.com" - must include path +* "foo.example.com" - must include path + +_Validation:_ +- MaxLength: 253 +- MinLength: 1 +- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` + +_Appears in:_ +- [ParentStatus](#parentstatus) + + + #### EndpointPickerFailureMode _Underlying type:_ _string_ @@ -124,7 +150,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | | `selector` _[LabelSelector](#labelselector)_ | Selector determines which Pods are members of this inference pool.
It matches Pods by their labels only within the same namespace; cross-namespace
selection is not supported.
The structure of this LabelSelector is intentionally simple to be compatible
with Kubernetes Service selectors, as some implementations may translate
this configuration into a Service resource. | | | -| `targetPorts` _[Port](#port) array_ | TargetPorts defines a list of ports that are exposed by this InferencePool.
Currently, the list may only include a single port definition. | | MaxItems: 1
MinItems: 1
| +| `targetPorts` _[Port](#port) array_ | TargetPorts defines a list of ports that are exposed by this InferencePool.
Every port will be treated as a distinctive endpoint by EPP,
addressable as a 'podIP:portNumber' combination. | | MaxItems: 8
MinItems: 1
| | `endpointPickerRef` _[EndpointPickerRef](#endpointpickerref)_ | EndpointPickerRef is a reference to the Endpoint Picker extension and its
associated configuration. | | | @@ -294,32 +320,6 @@ _Appears in:_ -#### ParentController - -_Underlying type:_ _string_ - -ParentController is the name of a controller that manages ParentStatus. It must be a domain prefixed -path. - -Valid values include: - -* "example.com/bar" - -Invalid values include: - -* "example.com" - must include path -* "foo.example.com" - must include path - -_Validation:_ -- MaxLength: 253 -- MinLength: 1 -- Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` - -_Appears in:_ -- [ParentStatus](#parentstatus) - - - #### ParentReference @@ -355,7 +355,7 @@ _Appears in:_ | --- | --- | --- | --- | | `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | Conditions is a list of status conditions that provide information about the observed
state of the InferencePool. This field is required to be set by the controller that
manages the InferencePool.
Supported condition types are:
* "Accepted"
* "ResolvedRefs" | | MaxItems: 8
| | `parentRef` _[ParentReference](#parentreference)_ | ParentRef is used to identify the parent resource that this status
is associated with. It is used to match the InferencePool with the parent
resource, such as a Gateway. | | | -| `controllerName` _[ParentController](#parentcontroller)_ | ControllerName is a domain/path string that indicates the name of the controller that
wrote this status. This corresponds with the GatewayClass controllerName field when the
parentRef references a Gateway kind.
Example: "example.net/gateway-controller".
The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Controllers MUST populate this field when writing status. Controllers should ensure that
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary. | | MaxLength: 253
MinLength: 1
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
| +| `controllerName` _[ControllerName](#controllername)_ | ControllerName is a domain/path string that indicates the name of the controller that
wrote this status. This corresponds with the GatewayClass controllerName field when the
parentRef references a Gateway kind.
Example: "example.net/gateway-controller".
The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Controllers MUST populate this field when writing status. Controllers should ensure that
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary. | | MaxLength: 253
MinLength: 1
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
| #### Port diff --git a/site-src/reference/x-v1a1-spec.md b/site-src/reference/x-v1a1-spec.md index 338caa47d..e2eb00742 100644 --- a/site-src/reference/x-v1a1-spec.md +++ b/site-src/reference/x-v1a1-spec.md @@ -15,6 +15,21 @@ inference.networking.x-k8s.io API group. +#### ClusterName + +_Underlying type:_ _string_ + +ClusterName is the name of a cluster that exported the InferencePool. + +_Validation:_ +- MaxLength: 253 +- MinLength: 1 + +_Appears in:_ +- [ExportingCluster](#exportingcluster) + + + #### ControllerName _Underlying type:_ _string_ @@ -44,7 +59,7 @@ _Appears in:_ -ExportingCluster defines a cluster that exported the InferencePool associated to this InferencePoolImport. +ExportingCluster defines a cluster that exported the InferencePool that backs this InferencePoolImport. @@ -53,7 +68,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `name` _string_ | Name of the exporting cluster (must be unique within the list). | | Required: \{\}
| +| `name` _[ClusterName](#clustername)_ | Name of the exporting cluster (must be unique within the list). | | MaxLength: 253
MinLength: 1
Required: \{\}
| #### ImportController @@ -90,23 +105,9 @@ InferencePoolImport is the Schema for the InferencePoolImports API. | `apiVersion` _string_ | `inference.networking.x-k8s.io/v1alpha1` | | | | `kind` _string_ | `InferencePoolImport` | | | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `spec` _[InferencePoolImportSpec](#inferencepoolimportspec)_ | Spec defines the desired state of the InferencePoolImport. | | | | `status` _[InferencePoolImportStatus](#inferencepoolimportstatus)_ | Status defines the observed state of the InferencePoolImport. | | | -#### InferencePoolImportSpec - - - -InferencePoolImportSpec defines the desired state of the InferencePoolImport. - - - -_Appears in:_ -- [InferencePoolImport](#inferencepoolimport) - - - #### InferencePoolImportStatus