diff --git a/Dockerfile b/Dockerfile index 261ec1b5f..21a629cbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN go mod download COPY cmd/epp ./cmd/epp COPY pkg/epp ./pkg/epp COPY internal ./internal +COPY apix ./apix COPY api ./api COPY version ./version WORKDIR /src/cmd/epp diff --git a/api/v1/doc.go b/api/v1/doc.go new file mode 100644 index 000000000..e34371efe --- /dev/null +++ b/api/v1/doc.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 v1 contains API Schema definitions for the +// inference.networking.k8s.io API group. +// +// +k8s:openapi-gen=true +// +kubebuilder:object:generate=true +// +groupName=inference.networking.k8s.io +// +groupGoName=Inference +package v1 diff --git a/api/v1/inferencepool_types.go b/api/v1/inferencepool_types.go new file mode 100644 index 000000000..98f45d5bb --- /dev/null +++ b/api/v1/inferencepool_types.go @@ -0,0 +1,293 @@ +/* +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 v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InferencePool is the Schema for the InferencePools API. +// +// +kubebuilder:object:root=true +// TODO: change the annotation once it gets officially approved +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=unapproved, experimental-only" +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +genclient +type InferencePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec InferencePoolSpec `json:"spec,omitempty"` + + // Status defines the observed state of InferencePool. + // + // +kubebuilder:default={parent: {{parentRef: {kind: "Status", name: "default"}, conditions: {{type: "Accepted", status: "Unknown", reason: "Pending", message: "Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}}} + Status InferencePoolStatus `json:"status,omitempty"` +} + +// InferencePoolList contains a list of InferencePool. +// +// +kubebuilder:object:root=true +type InferencePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []InferencePool `json:"items"` +} + +// InferencePoolSpec defines the desired state of InferencePool +type InferencePoolSpec struct { + // Selector defines a map of labels to watch model server Pods + // that should be included in the InferencePool. + // In some cases, implementations may translate this field to a Service selector, so this matches the simple + // map used for Service selectors instead of the full Kubernetes LabelSelector type. + // If specified, it will be applied to match the model server pods in the same namespace as the InferencePool. + // Cross namesoace selector is not supported. + // + // +kubebuilder:validation:Required + Selector map[LabelKey]LabelValue `json:"selector"` + + // TargetPortNumber defines the port number to access the selected model server Pods. + // The number must be in the range 1 to 65535. + // + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + // +kubebuilder:validation:Required + TargetPortNumber int32 `json:"targetPortNumber"` + + // EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint + // picker service that picks endpoints for the requests routed to this pool. + EndpointPickerConfig `json:",inline"` +} + +// EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint picker extension. +// This type is intended to be a union of mutually exclusive configuration options that we may add in the future. +type EndpointPickerConfig struct { + // Extension configures an endpoint picker as an extension service. + // + // +kubebuilder:validation:Required + ExtensionRef *Extension `json:"extensionRef,omitempty"` +} + +// Extension specifies how to configure an extension that runs the endpoint picker. +type Extension struct { + // Reference is a reference to a service extension. When ExtensionReference is invalid, + // a 5XX status code MUST be returned for the request that would have otherwise been routed + // to the invalid backend. + ExtensionReference `json:",inline"` + + // ExtensionConnection configures the connection between the Gateway and the extension. + ExtensionConnection `json:",inline"` +} + +// ExtensionReference is a reference to the extension. +// +// If a reference is invalid, the implementation MUST update the `ResolvedRefs` +// Condition on the InferencePool's status to `status: False`. A 5XX status code MUST be returned +// for the request that would have otherwise been routed to the invalid backend. +type ExtensionReference struct { + // Group is the group of the referent. + // The default value is "", representing the Core API group. + // + // +optional + // +kubebuilder:default="" + Group *Group `json:"group,omitempty"` + + // Kind is the Kubernetes resource kind of the referent. + // + // Defaults to "Service" when not specified. + // + // ExternalName services can refer to CNAME DNS records that may live + // outside of the cluster and as such are difficult to reason about in + // terms of conformance. They also may not be safe to forward to (see + // CVE-2021-25740 for more information). Implementations MUST NOT + // support ExternalName Services. + // + // +optional + // +kubebuilder:default=Service + Kind *Kind `json:"kind,omitempty"` + + // Name is the name of the referent. + // + // +kubebuilder:validation:Required + Name ObjectName `json:"name"` + + // The port number on the service running the extension. When unspecified, + // implementations SHOULD infer a default value of 9002 when the Kind is + // Service. + // + // +optional + PortNumber *PortNumber `json:"portNumber,omitempty"` +} + +// ExtensionConnection encapsulates options that configures the connection to the extension. +type ExtensionConnection struct { + // Configures how the gateway handles the case when the extension is not responsive. + // Defaults to failClose. + // + // +optional + // +kubebuilder:default="FailClose" + FailureMode *ExtensionFailureMode `json:"failureMode"` +} + +// ExtensionFailureMode defines the options for how the gateway handles the case when the extension is not +// responsive. +// +kubebuilder:validation:Enum=FailOpen;FailClose +type ExtensionFailureMode string + +const ( + // FailOpen specifies that the proxy should forward the request to an endpoint of its picking when the Endpoint Picker fails. + FailOpen ExtensionFailureMode = "FailOpen" + // FailClose specifies that the proxy should drop the request when the Endpoint Picker fails. + FailClose ExtensionFailureMode = "FailClose" +) + +// InferencePoolStatus defines the observed state of InferencePool. +type InferencePoolStatus struct { + // Parents is a list of parent resources (usually Gateways) that are + // associated with the InferencePool, and the status of the InferencePool with respect to + // each parent. + // + // A maximum of 32 Gateways will be represented in this list. When the list contains + // `kind: Status, name: default`, it indicates that the InferencePool is not + // associated with any Gateway and a controller must perform the following: + // + // - Remove the parent when setting the "Accepted" condition. + // - Add the parent when the controller will no longer manage the InferencePool + // and no other parents exist. + // + // +kubebuilder:validation:MaxItems=32 + Parents []PoolStatus `json:"parent,omitempty"` +} + +// PoolStatus defines the observed state of InferencePool from a Gateway. +type PoolStatus struct { + // GatewayRef indicates the gateway that observed state of InferencePool. + GatewayRef ParentGatewayReference `json:"parentRef"` + + // Conditions track the state of the InferencePool. + // + // Known condition types are: + // + // * "Accepted" + // * "ResolvedRefs" + // + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:default={{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}} + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// InferencePoolConditionType is a type of condition for the InferencePool +type InferencePoolConditionType string + +// InferencePoolReason is the reason for a given InferencePoolConditionType +type InferencePoolReason string + +const ( + // This condition indicates whether the InferencePool has been accepted or rejected + // by a Gateway, and why. + // + // Possible reasons for this condition to be True are: + // + // * "Accepted" + // + // Possible reasons for this condition to be False are: + // + // * "NotSupportedByGateway" + // * "HTTPRouteNotAccepted" + // + // Possible reasons for this condition to be Unknown are: + // + // * "Pending" + // + // Controllers MAY raise this condition with other reasons, but should + // prefer to use the reasons listed above to improve interoperability. + InferencePoolConditionAccepted InferencePoolConditionType = "Accepted" + + // This reason is used with the "Accepted" condition when the InferencePool has been + // accepted by the Gateway. + InferencePoolReasonAccepted InferencePoolReason = "Accepted" + + // This reason is used with the "Accepted" condition when the InferencePool + // has not been accepted by a Gateway because the Gateway does not support + // InferencePool as a backend. + InferencePoolReasonNotSupportedByGateway InferencePoolReason = "NotSupportedByGateway" + + // This reason is used with the "Accepted" condition when the InferencePool is + // referenced by an HTTPRoute that has been rejected by the Gateway. The user + // should inspect the status of the referring HTTPRoute for the specific reason. + InferencePoolReasonHTTPRouteNotAccepted InferencePoolReason = "HTTPRouteNotAccepted" + + // This reason is used with the "Accepted" when a controller has not yet + // reconciled the InferencePool. + InferencePoolReasonPending InferencePoolReason = "Pending" +) + +const ( + // This condition indicates whether the controller was able to resolve all + // the object references for the InferencePool. + // + // Possible reasons for this condition to be True are: + // + // * "ResolvedRefs" + // + // Possible reasons for this condition to be False are: + // + // * "InvalidExtensionRef" + // + // Controllers MAY raise this condition with other reasons, but should + // prefer to use the reasons listed above to improve interoperability. + InferencePoolConditionResolvedRefs InferencePoolConditionType = "ResolvedRefs" + + // This reason is used with the "ResolvedRefs" condition when the condition + // is true. + InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs" + + // This reason is used with the "ResolvedRefs" condition when the + // ExtensionRef is invalid in some way. This can include an unsupported kind + // or API group, or a reference to a resource that can not be found. + InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef" +) + +// ParentGatewayReference identifies an API object including its namespace, +// defaulting to Gateway. +type ParentGatewayReference struct { + // Group is the group of the referent. + // + // +optional + // +kubebuilder:default="gateway.networking.k8s.io" + Group *Group `json:"group"` + + // Kind is kind of the referent. For example "Gateway". + // + // +optional + // +kubebuilder:default=Gateway + Kind *Kind `json:"kind"` + + // Name is the name of the referent. + Name ObjectName `json:"name"` + + // Namespace is the namespace of the referent. If not present, + // the namespace of the referent is assumed to be the same as + // the namespace of the referring object. + // + // +optional + Namespace *Namespace `json:"namespace,omitempty"` +} diff --git a/api/v1/shared_types.go b/api/v1/shared_types.go new file mode 100644 index 000000000..800291b33 --- /dev/null +++ b/api/v1/shared_types.go @@ -0,0 +1,129 @@ +/* +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 v1 + +// Group refers to a Kubernetes Group. It must either be an empty string or a +// RFC 1123 subdomain. +// +// This validation is based off of the corresponding Kubernetes validation: +// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208 +// +// Valid values include: +// +// * "" - empty string implies core Kubernetes API group +// * "gateway.networking.k8s.io" +// * "foo.example.com" +// +// Invalid values include: +// +// * "example.com/bar" - "/" is an invalid character +// +// +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])?)*$` +type Group string + +// Kind refers to a Kubernetes Kind. +// +// Valid values include: +// +// * "Service" +// * "HTTPRoute" +// +// Invalid values include: +// +// * "invalid/kind" - "/" is an invalid character +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=63 +// +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` +type Kind string + +// ObjectName refers to the name of a Kubernetes object. +// Object names can have a variety of forms, including RFC 1123 subdomains, +// RFC 1123 labels, or RFC 1035 labels. +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +type ObjectName string + +// Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label. +// +// This validation is based off of the corresponding Kubernetes validation: +// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187 +// +// This is used for Namespace name validation here: +// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63 +// +// Valid values include: +// +// * "example" +// +// Invalid values include: +// +// * "example.com" - "." is an invalid character +// +// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=63 +type Namespace string + +// PortNumber defines a network port. +// +// +kubebuilder:validation:Minimum=1 +// +kubebuilder:validation:Maximum=65535 +type PortNumber int32 + +// LabelKey was originally copied from: https://github.com/kubernetes-sigs/gateway-api/blob/99a3934c6bc1ce0874f3a4c5f20cafd8977ffcb4/apis/v1/shared_types.go#L694-L731 +// Duplicated as to not take an unexpected dependency on gw's API. +// +// LabelKey is the key of a label. This is used for validation +// of maps. This matches the Kubernetes "qualified name" validation that is used for labels. +// Labels are case sensitive, so: my-label and My-Label are considered distinct. +// +// Valid values include: +// +// * example +// * example.com +// * example.com/path +// * example.com/path.html +// +// Invalid values include: +// +// * example~ - "~" is an invalid character +// * example.com. - can not start or end with "." +// +// +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][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$` +type LabelKey string + +// LabelValue is the value of a label. This is used for validation +// of maps. This matches the Kubernetes label validation rules: +// * must be 63 characters or less (can be empty), +// * unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), +// * could contain dashes (-), underscores (_), dots (.), and alphanumerics between. +// +// Valid values include: +// +// * MyValue +// * my.name +// * 123-my-value +// +// +kubebuilder:validation:MinLength=0 +// +kubebuilder:validation:MaxLength=63 +// +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$` +type LabelValue string diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..adf19acbe --- /dev/null +++ b/api/v1/zz_generated.deepcopy.go @@ -0,0 +1,270 @@ +//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 v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointPickerConfig) DeepCopyInto(out *EndpointPickerConfig) { + *out = *in + if in.ExtensionRef != nil { + in, out := &in.ExtensionRef, &out.ExtensionRef + *out = new(Extension) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointPickerConfig. +func (in *EndpointPickerConfig) DeepCopy() *EndpointPickerConfig { + if in == nil { + return nil + } + out := new(EndpointPickerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Extension) DeepCopyInto(out *Extension) { + *out = *in + in.ExtensionReference.DeepCopyInto(&out.ExtensionReference) + in.ExtensionConnection.DeepCopyInto(&out.ExtensionConnection) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Extension. +func (in *Extension) DeepCopy() *Extension { + if in == nil { + return nil + } + out := new(Extension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionConnection) DeepCopyInto(out *ExtensionConnection) { + *out = *in + if in.FailureMode != nil { + in, out := &in.FailureMode, &out.FailureMode + *out = new(ExtensionFailureMode) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConnection. +func (in *ExtensionConnection) DeepCopy() *ExtensionConnection { + if in == nil { + return nil + } + out := new(ExtensionConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionReference) DeepCopyInto(out *ExtensionReference) { + *out = *in + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(Group) + **out = **in + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(Kind) + **out = **in + } + if in.PortNumber != nil { + in, out := &in.PortNumber, &out.PortNumber + *out = new(PortNumber) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionReference. +func (in *ExtensionReference) DeepCopy() *ExtensionReference { + if in == nil { + return nil + } + out := new(ExtensionReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePool) DeepCopyInto(out *InferencePool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePool. +func (in *InferencePool) DeepCopy() *InferencePool { + if in == nil { + return nil + } + out := new(InferencePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InferencePool) 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 *InferencePoolList) DeepCopyInto(out *InferencePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InferencePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolList. +func (in *InferencePoolList) DeepCopy() *InferencePoolList { + if in == nil { + return nil + } + out := new(InferencePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InferencePoolList) 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 *InferencePoolSpec) DeepCopyInto(out *InferencePoolSpec) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = make(map[LabelKey]LabelValue, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.EndpointPickerConfig.DeepCopyInto(&out.EndpointPickerConfig) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolSpec. +func (in *InferencePoolSpec) DeepCopy() *InferencePoolSpec { + if in == nil { + return nil + } + out := new(InferencePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InferencePoolStatus) DeepCopyInto(out *InferencePoolStatus) { + *out = *in + if in.Parents != nil { + in, out := &in.Parents, &out.Parents + *out = make([]PoolStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolStatus. +func (in *InferencePoolStatus) DeepCopy() *InferencePoolStatus { + if in == nil { + return nil + } + out := new(InferencePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ParentGatewayReference) DeepCopyInto(out *ParentGatewayReference) { + *out = *in + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(Group) + **out = **in + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(Kind) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(Namespace) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentGatewayReference. +func (in *ParentGatewayReference) DeepCopy() *ParentGatewayReference { + if in == nil { + return nil + } + out := new(ParentGatewayReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolStatus) DeepCopyInto(out *PoolStatus) { + *out = *in + in.GatewayRef.DeepCopyInto(&out.GatewayRef) + 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 PoolStatus. +func (in *PoolStatus) DeepCopy() *PoolStatus { + if in == nil { + return nil + } + out := new(PoolStatus) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1/zz_generated.register.go b/api/v1/zz_generated.register.go new file mode 100644 index 000000000..61a8642ff --- /dev/null +++ b/api/v1/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 v1 + +import ( + metav1 "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.k8s.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = metav1.GroupVersion{Group: GroupName, Version: "v1"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + +// 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, + &InferencePool{}, + &InferencePoolList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/api/config/v1alpha1/defaults.go b/apix/config/v1alpha1/defaults.go similarity index 100% rename from api/config/v1alpha1/defaults.go rename to apix/config/v1alpha1/defaults.go diff --git a/api/config/v1alpha1/doc.go b/apix/config/v1alpha1/doc.go similarity index 100% rename from api/config/v1alpha1/doc.go rename to apix/config/v1alpha1/doc.go diff --git a/api/config/v1alpha1/endpointpickerconfig_types.go b/apix/config/v1alpha1/endpointpickerconfig_types.go similarity index 100% rename from api/config/v1alpha1/endpointpickerconfig_types.go rename to apix/config/v1alpha1/endpointpickerconfig_types.go diff --git a/api/config/v1alpha1/zz_generated.deepcopy.go b/apix/config/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from api/config/v1alpha1/zz_generated.deepcopy.go rename to apix/config/v1alpha1/zz_generated.deepcopy.go diff --git a/api/config/v1alpha1/zz_generated.defaults.go b/apix/config/v1alpha1/zz_generated.defaults.go similarity index 100% rename from api/config/v1alpha1/zz_generated.defaults.go rename to apix/config/v1alpha1/zz_generated.defaults.go diff --git a/api/config/v1alpha1/zz_generated.register.go b/apix/config/v1alpha1/zz_generated.register.go similarity index 100% rename from api/config/v1alpha1/zz_generated.register.go rename to apix/config/v1alpha1/zz_generated.register.go diff --git a/apix/doc.go b/apix/doc.go new file mode 100644 index 000000000..e81abb6dd --- /dev/null +++ b/apix/doc.go @@ -0,0 +1,17 @@ +/* +Copyright 2024 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 apix diff --git a/api/v1alpha2/doc.go b/apix/v1alpha2/doc.go similarity index 96% rename from api/v1alpha2/doc.go rename to apix/v1alpha2/doc.go index 90a35f58c..54d3757b7 100644 --- a/api/v1alpha2/doc.go +++ b/apix/v1alpha2/doc.go @@ -20,4 +20,5 @@ limitations under the License. // +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=inference.networking.x-k8s.io +// +groupGoName=XInference package v1alpha2 diff --git a/api/v1alpha2/inferencemodel_types.go b/apix/v1alpha2/inferencemodel_types.go similarity index 100% rename from api/v1alpha2/inferencemodel_types.go rename to apix/v1alpha2/inferencemodel_types.go diff --git a/api/v1alpha2/inferencepool_types.go b/apix/v1alpha2/inferencepool_types.go similarity index 93% rename from api/v1alpha2/inferencepool_types.go rename to apix/v1alpha2/inferencepool_types.go index 1edb7ce18..0213d86e3 100644 --- a/api/v1alpha2/inferencepool_types.go +++ b/apix/v1alpha2/inferencepool_types.go @@ -23,6 +23,8 @@ import ( // InferencePool is the Schema for the InferencePools API. // // +kubebuilder:object:root=true +// TODO: change the annotation once it gets officially approved +// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=unapproved, experimental-only" // +kubebuilder:subresource:status // +kubebuilder:storageversion // +genclient @@ -49,17 +51,17 @@ type InferencePoolList struct { // InferencePoolSpec defines the desired state of InferencePool type InferencePoolSpec struct { - // Selector defines a map of labels to watch model server pods + // Selector defines a map of labels to watch model server Pods // that should be included in the InferencePool. // In some cases, implementations may translate this field to a Service selector, so this matches the simple // map used for Service selectors instead of the full Kubernetes LabelSelector type. - // If sepecified, it will be applied to match the model server pods in the same namespace as the InferencePool. + // If specified, it will be applied to match the model server pods in the same namespace as the InferencePool. // Cross namesoace selector is not supported. // // +kubebuilder:validation:Required Selector map[LabelKey]LabelValue `json:"selector"` - // TargetPortNumber defines the port number to access the selected model servers. + // TargetPortNumber defines the port number to access the selected model server Pods. // The number must be in the range 1 to 65535. // // +kubebuilder:validation:Minimum=1 @@ -88,7 +90,7 @@ type Extension struct { // to the invalid backend. ExtensionReference `json:",inline"` - // ExtensionConnection configures the connection between the gateway and the extension. + // ExtensionConnection configures the connection between the Gateway and the extension. ExtensionConnection `json:",inline"` } @@ -110,8 +112,7 @@ type ExtensionReference struct { // +kubebuilder:default="" Group *Group `json:"group,omitempty"` - // Kind is the Kubernetes resource kind of the referent. For example - // "Service". + // Kind is the Kubernetes resource kind of the referent. // // Defaults to "Service" when not specified. // @@ -154,9 +155,9 @@ type ExtensionConnection struct { type ExtensionFailureMode string const ( - // FailOpen specifies that the proxy should not drop the request and forward the request to and endpoint of its picking. + // FailOpen specifies that the proxy should forward the request to an endpoint of its picking when the Endpoint Picker fails. FailOpen ExtensionFailureMode = "FailOpen" - // FailClose specifies that the proxy should drop the request. + // FailClose specifies that the proxy should drop the request when the Endpoint Picker fails. FailClose ExtensionFailureMode = "FailClose" ) diff --git a/api/v1alpha2/shared_types.go b/apix/v1alpha2/shared_types.go similarity index 100% rename from api/v1alpha2/shared_types.go rename to apix/v1alpha2/shared_types.go index d3829ef0a..1fe46ddae 100644 --- a/api/v1alpha2/shared_types.go +++ b/apix/v1alpha2/shared_types.go @@ -60,6 +60,27 @@ type Kind string // +kubebuilder:validation:MaxLength=253 type ObjectName string +// Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label. +// +// This validation is based off of the corresponding Kubernetes validation: +// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187 +// +// This is used for Namespace name validation here: +// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63 +// +// Valid values include: +// +// * "example" +// +// Invalid values include: +// +// * "example.com" - "." is an invalid character +// +// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=63 +type Namespace string + // PortNumber defines a network port. // // +kubebuilder:validation:Minimum=1 @@ -106,24 +127,3 @@ type LabelKey string // +kubebuilder:validation:MaxLength=63 // +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$` type LabelValue string - -// Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label. -// -// This validation is based off of the corresponding Kubernetes validation: -// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187 -// -// This is used for Namespace name validation here: -// https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63 -// -// Valid values include: -// -// * "example" -// -// Invalid values include: -// -// * "example.com" - "." is an invalid character -// -// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` -// +kubebuilder:validation:MinLength=1 -// +kubebuilder:validation:MaxLength=63 -type Namespace string diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/apix/v1alpha2/zz_generated.deepcopy.go similarity index 100% rename from api/v1alpha2/zz_generated.deepcopy.go rename to apix/v1alpha2/zz_generated.deepcopy.go diff --git a/api/v1alpha2/zz_generated.register.go b/apix/v1alpha2/zz_generated.register.go similarity index 100% rename from api/v1alpha2/zz_generated.register.go rename to apix/v1alpha2/zz_generated.register.go diff --git a/client-go/applyconfiguration/api/v1/endpointpickerconfig.go b/client-go/applyconfiguration/api/v1/endpointpickerconfig.go new file mode 100644 index 000000000..9877d40d9 --- /dev/null +++ b/client-go/applyconfiguration/api/v1/endpointpickerconfig.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 v1 + +// EndpointPickerConfigApplyConfiguration represents a declarative configuration of the EndpointPickerConfig type for use +// with apply. +type EndpointPickerConfigApplyConfiguration struct { + ExtensionRef *ExtensionApplyConfiguration `json:"extensionRef,omitempty"` +} + +// EndpointPickerConfigApplyConfiguration constructs a declarative configuration of the EndpointPickerConfig type for use with +// apply. +func EndpointPickerConfig() *EndpointPickerConfigApplyConfiguration { + return &EndpointPickerConfigApplyConfiguration{} +} + +// WithExtensionRef sets the ExtensionRef 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 ExtensionRef field is set to the value of the last call. +func (b *EndpointPickerConfigApplyConfiguration) WithExtensionRef(value *ExtensionApplyConfiguration) *EndpointPickerConfigApplyConfiguration { + b.ExtensionRef = value + return b +} diff --git a/client-go/applyconfiguration/api/v1alpha2/extension.go b/client-go/applyconfiguration/api/v1/extension.go similarity index 85% rename from client-go/applyconfiguration/api/v1alpha2/extension.go rename to client-go/applyconfiguration/api/v1/extension.go index 87c982e07..b14ec837e 100644 --- a/client-go/applyconfiguration/api/v1alpha2/extension.go +++ b/client-go/applyconfiguration/api/v1/extension.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" ) // ExtensionApplyConfiguration represents a declarative configuration of the Extension type for use @@ -38,7 +38,7 @@ func Extension() *ExtensionApplyConfiguration { // WithGroup sets the Group 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 Group field is set to the value of the last call. -func (b *ExtensionApplyConfiguration) WithGroup(value apiv1alpha2.Group) *ExtensionApplyConfiguration { +func (b *ExtensionApplyConfiguration) WithGroup(value apiv1.Group) *ExtensionApplyConfiguration { b.ExtensionReferenceApplyConfiguration.Group = &value return b } @@ -46,7 +46,7 @@ func (b *ExtensionApplyConfiguration) WithGroup(value apiv1alpha2.Group) *Extens // 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 *ExtensionApplyConfiguration) WithKind(value apiv1alpha2.Kind) *ExtensionApplyConfiguration { +func (b *ExtensionApplyConfiguration) WithKind(value apiv1.Kind) *ExtensionApplyConfiguration { b.ExtensionReferenceApplyConfiguration.Kind = &value return b } @@ -54,7 +54,7 @@ func (b *ExtensionApplyConfiguration) WithKind(value apiv1alpha2.Kind) *Extensio // 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 *ExtensionApplyConfiguration) WithName(value apiv1alpha2.ObjectName) *ExtensionApplyConfiguration { +func (b *ExtensionApplyConfiguration) WithName(value apiv1.ObjectName) *ExtensionApplyConfiguration { b.ExtensionReferenceApplyConfiguration.Name = &value return b } @@ -62,7 +62,7 @@ func (b *ExtensionApplyConfiguration) WithName(value apiv1alpha2.ObjectName) *Ex // WithPortNumber sets the PortNumber 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 PortNumber field is set to the value of the last call. -func (b *ExtensionApplyConfiguration) WithPortNumber(value apiv1alpha2.PortNumber) *ExtensionApplyConfiguration { +func (b *ExtensionApplyConfiguration) WithPortNumber(value apiv1.PortNumber) *ExtensionApplyConfiguration { b.ExtensionReferenceApplyConfiguration.PortNumber = &value return b } @@ -70,7 +70,7 @@ func (b *ExtensionApplyConfiguration) WithPortNumber(value apiv1alpha2.PortNumbe // WithFailureMode sets the FailureMode 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 FailureMode field is set to the value of the last call. -func (b *ExtensionApplyConfiguration) WithFailureMode(value apiv1alpha2.ExtensionFailureMode) *ExtensionApplyConfiguration { +func (b *ExtensionApplyConfiguration) WithFailureMode(value apiv1.ExtensionFailureMode) *ExtensionApplyConfiguration { b.ExtensionConnectionApplyConfiguration.FailureMode = &value return b } diff --git a/client-go/applyconfiguration/api/v1/extensionconnection.go b/client-go/applyconfiguration/api/v1/extensionconnection.go new file mode 100644 index 000000000..cc078272d --- /dev/null +++ b/client-go/applyconfiguration/api/v1/extensionconnection.go @@ -0,0 +1,43 @@ +/* +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 v1 + +import ( + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// ExtensionConnectionApplyConfiguration represents a declarative configuration of the ExtensionConnection type for use +// with apply. +type ExtensionConnectionApplyConfiguration struct { + FailureMode *apiv1.ExtensionFailureMode `json:"failureMode,omitempty"` +} + +// ExtensionConnectionApplyConfiguration constructs a declarative configuration of the ExtensionConnection type for use with +// apply. +func ExtensionConnection() *ExtensionConnectionApplyConfiguration { + return &ExtensionConnectionApplyConfiguration{} +} + +// WithFailureMode sets the FailureMode 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 FailureMode field is set to the value of the last call. +func (b *ExtensionConnectionApplyConfiguration) WithFailureMode(value apiv1.ExtensionFailureMode) *ExtensionConnectionApplyConfiguration { + b.FailureMode = &value + return b +} diff --git a/client-go/applyconfiguration/api/v1/extensionreference.go b/client-go/applyconfiguration/api/v1/extensionreference.go new file mode 100644 index 000000000..21402d15a --- /dev/null +++ b/client-go/applyconfiguration/api/v1/extensionreference.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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// ExtensionReferenceApplyConfiguration represents a declarative configuration of the ExtensionReference type for use +// with apply. +type ExtensionReferenceApplyConfiguration struct { + Group *apiv1.Group `json:"group,omitempty"` + Kind *apiv1.Kind `json:"kind,omitempty"` + Name *apiv1.ObjectName `json:"name,omitempty"` + PortNumber *apiv1.PortNumber `json:"portNumber,omitempty"` +} + +// ExtensionReferenceApplyConfiguration constructs a declarative configuration of the ExtensionReference type for use with +// apply. +func ExtensionReference() *ExtensionReferenceApplyConfiguration { + return &ExtensionReferenceApplyConfiguration{} +} + +// WithGroup sets the Group 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 Group field is set to the value of the last call. +func (b *ExtensionReferenceApplyConfiguration) WithGroup(value apiv1.Group) *ExtensionReferenceApplyConfiguration { + b.Group = &value + return b +} + +// 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 *ExtensionReferenceApplyConfiguration) WithKind(value apiv1.Kind) *ExtensionReferenceApplyConfiguration { + b.Kind = &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 *ExtensionReferenceApplyConfiguration) WithName(value apiv1.ObjectName) *ExtensionReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithPortNumber sets the PortNumber 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 PortNumber field is set to the value of the last call. +func (b *ExtensionReferenceApplyConfiguration) WithPortNumber(value apiv1.PortNumber) *ExtensionReferenceApplyConfiguration { + b.PortNumber = &value + return b +} diff --git a/client-go/applyconfiguration/api/v1/inferencepool.go b/client-go/applyconfiguration/api/v1/inferencepool.go new file mode 100644 index 000000000..eaea68c3b --- /dev/null +++ b/client-go/applyconfiguration/api/v1/inferencepool.go @@ -0,0 +1,225 @@ +/* +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 v1 + +import ( + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InferencePoolApplyConfiguration represents a declarative configuration of the InferencePool type for use +// with apply. +type InferencePoolApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *InferencePoolSpecApplyConfiguration `json:"spec,omitempty"` + Status *InferencePoolStatusApplyConfiguration `json:"status,omitempty"` +} + +// InferencePool constructs a declarative configuration of the InferencePool type for use with +// apply. +func InferencePool(name, namespace string) *InferencePoolApplyConfiguration { + b := &InferencePoolApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("InferencePool") + b.WithAPIVersion("inference.networking.k8s.io/v1") + return b +} + +// 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 *InferencePoolApplyConfiguration) WithKind(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithAPIVersion(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithName(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithGenerateName(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithNamespace(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithUID(value types.UID) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithResourceVersion(value string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithGeneration(value int64) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithLabels(entries map[string]string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithAnnotations(entries map[string]string) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithFinalizers(values ...string) *InferencePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InferencePoolApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.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 *InferencePoolApplyConfiguration) WithSpec(value *InferencePoolSpecApplyConfiguration) *InferencePoolApplyConfiguration { + 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 *InferencePoolApplyConfiguration) WithStatus(value *InferencePoolStatusApplyConfiguration) *InferencePoolApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InferencePoolApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/client-go/applyconfiguration/api/v1/inferencepoolspec.go b/client-go/applyconfiguration/api/v1/inferencepoolspec.go new file mode 100644 index 000000000..d9c08b238 --- /dev/null +++ b/client-go/applyconfiguration/api/v1/inferencepoolspec.go @@ -0,0 +1,67 @@ +/* +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 v1 + +import ( + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// InferencePoolSpecApplyConfiguration represents a declarative configuration of the InferencePoolSpec type for use +// with apply. +type InferencePoolSpecApplyConfiguration struct { + Selector map[apiv1.LabelKey]apiv1.LabelValue `json:"selector,omitempty"` + TargetPortNumber *int32 `json:"targetPortNumber,omitempty"` + EndpointPickerConfigApplyConfiguration `json:",inline"` +} + +// InferencePoolSpecApplyConfiguration constructs a declarative configuration of the InferencePoolSpec type for use with +// apply. +func InferencePoolSpec() *InferencePoolSpecApplyConfiguration { + return &InferencePoolSpecApplyConfiguration{} +} + +// WithSelector puts the entries into the Selector 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 Selector field, +// overwriting an existing map entries in Selector field with the same key. +func (b *InferencePoolSpecApplyConfiguration) WithSelector(entries map[apiv1.LabelKey]apiv1.LabelValue) *InferencePoolSpecApplyConfiguration { + if b.Selector == nil && len(entries) > 0 { + b.Selector = make(map[apiv1.LabelKey]apiv1.LabelValue, len(entries)) + } + for k, v := range entries { + b.Selector[k] = v + } + return b +} + +// WithTargetPortNumber sets the TargetPortNumber 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 TargetPortNumber field is set to the value of the last call. +func (b *InferencePoolSpecApplyConfiguration) WithTargetPortNumber(value int32) *InferencePoolSpecApplyConfiguration { + b.TargetPortNumber = &value + return b +} + +// WithExtensionRef sets the ExtensionRef 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 ExtensionRef field is set to the value of the last call. +func (b *InferencePoolSpecApplyConfiguration) WithExtensionRef(value *ExtensionApplyConfiguration) *InferencePoolSpecApplyConfiguration { + b.EndpointPickerConfigApplyConfiguration.ExtensionRef = value + return b +} diff --git a/client-go/applyconfiguration/api/v1/inferencepoolstatus.go b/client-go/applyconfiguration/api/v1/inferencepoolstatus.go new file mode 100644 index 000000000..5c66e3464 --- /dev/null +++ b/client-go/applyconfiguration/api/v1/inferencepoolstatus.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 v1 + +// InferencePoolStatusApplyConfiguration represents a declarative configuration of the InferencePoolStatus type for use +// with apply. +type InferencePoolStatusApplyConfiguration struct { + Parents []PoolStatusApplyConfiguration `json:"parent,omitempty"` +} + +// InferencePoolStatusApplyConfiguration constructs a declarative configuration of the InferencePoolStatus type for use with +// apply. +func InferencePoolStatus() *InferencePoolStatusApplyConfiguration { + return &InferencePoolStatusApplyConfiguration{} +} + +// 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 *InferencePoolStatusApplyConfiguration) WithParents(values ...*PoolStatusApplyConfiguration) *InferencePoolStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/client-go/applyconfiguration/api/v1/parentgatewayreference.go b/client-go/applyconfiguration/api/v1/parentgatewayreference.go new file mode 100644 index 000000000..5e23aebe6 --- /dev/null +++ b/client-go/applyconfiguration/api/v1/parentgatewayreference.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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" +) + +// ParentGatewayReferenceApplyConfiguration represents a declarative configuration of the ParentGatewayReference type for use +// with apply. +type ParentGatewayReferenceApplyConfiguration struct { + Group *apiv1.Group `json:"group,omitempty"` + Kind *apiv1.Kind `json:"kind,omitempty"` + Name *apiv1.ObjectName `json:"name,omitempty"` + Namespace *apiv1.Namespace `json:"namespace,omitempty"` +} + +// ParentGatewayReferenceApplyConfiguration constructs a declarative configuration of the ParentGatewayReference type for use with +// apply. +func ParentGatewayReference() *ParentGatewayReferenceApplyConfiguration { + return &ParentGatewayReferenceApplyConfiguration{} +} + +// WithGroup sets the Group 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 Group field is set to the value of the last call. +func (b *ParentGatewayReferenceApplyConfiguration) WithGroup(value apiv1.Group) *ParentGatewayReferenceApplyConfiguration { + b.Group = &value + return b +} + +// 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 *ParentGatewayReferenceApplyConfiguration) WithKind(value apiv1.Kind) *ParentGatewayReferenceApplyConfiguration { + b.Kind = &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 *ParentGatewayReferenceApplyConfiguration) WithName(value apiv1.ObjectName) *ParentGatewayReferenceApplyConfiguration { + b.Name = &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 *ParentGatewayReferenceApplyConfiguration) WithNamespace(value apiv1.Namespace) *ParentGatewayReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/client-go/applyconfiguration/api/v1/poolstatus.go b/client-go/applyconfiguration/api/v1/poolstatus.go new file mode 100644 index 000000000..64fe2dc2b --- /dev/null +++ b/client-go/applyconfiguration/api/v1/poolstatus.go @@ -0,0 +1,57 @@ +/* +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 v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PoolStatusApplyConfiguration represents a declarative configuration of the PoolStatus type for use +// with apply. +type PoolStatusApplyConfiguration struct { + GatewayRef *ParentGatewayReferenceApplyConfiguration `json:"parentRef,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// PoolStatusApplyConfiguration constructs a declarative configuration of the PoolStatus type for use with +// apply. +func PoolStatus() *PoolStatusApplyConfiguration { + return &PoolStatusApplyConfiguration{} +} + +// WithGatewayRef sets the GatewayRef 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 GatewayRef field is set to the value of the last call. +func (b *PoolStatusApplyConfiguration) WithGatewayRef(value *ParentGatewayReferenceApplyConfiguration) *PoolStatusApplyConfiguration { + b.GatewayRef = value + 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 *PoolStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PoolStatusApplyConfiguration { + 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/api/v1alpha2/endpointpickerconfig.go b/client-go/applyconfiguration/apix/v1alpha2/endpointpickerconfig.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/endpointpickerconfig.go rename to client-go/applyconfiguration/apix/v1alpha2/endpointpickerconfig.go diff --git a/client-go/applyconfiguration/apix/v1alpha2/extension.go b/client-go/applyconfiguration/apix/v1alpha2/extension.go new file mode 100644 index 000000000..e3690f965 --- /dev/null +++ b/client-go/applyconfiguration/apix/v1alpha2/extension.go @@ -0,0 +1,76 @@ +/* +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 v1alpha2 + +import ( + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" +) + +// ExtensionApplyConfiguration represents a declarative configuration of the Extension type for use +// with apply. +type ExtensionApplyConfiguration struct { + ExtensionReferenceApplyConfiguration `json:",inline"` + ExtensionConnectionApplyConfiguration `json:",inline"` +} + +// ExtensionApplyConfiguration constructs a declarative configuration of the Extension type for use with +// apply. +func Extension() *ExtensionApplyConfiguration { + return &ExtensionApplyConfiguration{} +} + +// WithGroup sets the Group 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 Group field is set to the value of the last call. +func (b *ExtensionApplyConfiguration) WithGroup(value apixv1alpha2.Group) *ExtensionApplyConfiguration { + b.ExtensionReferenceApplyConfiguration.Group = &value + return b +} + +// 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 *ExtensionApplyConfiguration) WithKind(value apixv1alpha2.Kind) *ExtensionApplyConfiguration { + b.ExtensionReferenceApplyConfiguration.Kind = &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 *ExtensionApplyConfiguration) WithName(value apixv1alpha2.ObjectName) *ExtensionApplyConfiguration { + b.ExtensionReferenceApplyConfiguration.Name = &value + return b +} + +// WithPortNumber sets the PortNumber 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 PortNumber field is set to the value of the last call. +func (b *ExtensionApplyConfiguration) WithPortNumber(value apixv1alpha2.PortNumber) *ExtensionApplyConfiguration { + b.ExtensionReferenceApplyConfiguration.PortNumber = &value + return b +} + +// WithFailureMode sets the FailureMode 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 FailureMode field is set to the value of the last call. +func (b *ExtensionApplyConfiguration) WithFailureMode(value apixv1alpha2.ExtensionFailureMode) *ExtensionApplyConfiguration { + b.ExtensionConnectionApplyConfiguration.FailureMode = &value + return b +} diff --git a/client-go/applyconfiguration/api/v1alpha2/extensionconnection.go b/client-go/applyconfiguration/apix/v1alpha2/extensionconnection.go similarity index 86% rename from client-go/applyconfiguration/api/v1alpha2/extensionconnection.go rename to client-go/applyconfiguration/apix/v1alpha2/extensionconnection.go index 25d703efd..17c1c6f72 100644 --- a/client-go/applyconfiguration/api/v1alpha2/extensionconnection.go +++ b/client-go/applyconfiguration/apix/v1alpha2/extensionconnection.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // ExtensionConnectionApplyConfiguration represents a declarative configuration of the ExtensionConnection type for use // with apply. type ExtensionConnectionApplyConfiguration struct { - FailureMode *apiv1alpha2.ExtensionFailureMode `json:"failureMode,omitempty"` + FailureMode *apixv1alpha2.ExtensionFailureMode `json:"failureMode,omitempty"` } // ExtensionConnectionApplyConfiguration constructs a declarative configuration of the ExtensionConnection type for use with @@ -37,7 +37,7 @@ func ExtensionConnection() *ExtensionConnectionApplyConfiguration { // WithFailureMode sets the FailureMode 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 FailureMode field is set to the value of the last call. -func (b *ExtensionConnectionApplyConfiguration) WithFailureMode(value apiv1alpha2.ExtensionFailureMode) *ExtensionConnectionApplyConfiguration { +func (b *ExtensionConnectionApplyConfiguration) WithFailureMode(value apixv1alpha2.ExtensionFailureMode) *ExtensionConnectionApplyConfiguration { b.FailureMode = &value return b } diff --git a/client-go/applyconfiguration/api/v1alpha2/extensionreference.go b/client-go/applyconfiguration/apix/v1alpha2/extensionreference.go similarity index 81% rename from client-go/applyconfiguration/api/v1alpha2/extensionreference.go rename to client-go/applyconfiguration/apix/v1alpha2/extensionreference.go index d9226a201..1142cf208 100644 --- a/client-go/applyconfiguration/api/v1alpha2/extensionreference.go +++ b/client-go/applyconfiguration/apix/v1alpha2/extensionreference.go @@ -19,16 +19,16 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // ExtensionReferenceApplyConfiguration represents a declarative configuration of the ExtensionReference type for use // with apply. type ExtensionReferenceApplyConfiguration struct { - Group *apiv1alpha2.Group `json:"group,omitempty"` - Kind *apiv1alpha2.Kind `json:"kind,omitempty"` - Name *apiv1alpha2.ObjectName `json:"name,omitempty"` - PortNumber *apiv1alpha2.PortNumber `json:"portNumber,omitempty"` + Group *apixv1alpha2.Group `json:"group,omitempty"` + Kind *apixv1alpha2.Kind `json:"kind,omitempty"` + Name *apixv1alpha2.ObjectName `json:"name,omitempty"` + PortNumber *apixv1alpha2.PortNumber `json:"portNumber,omitempty"` } // ExtensionReferenceApplyConfiguration constructs a declarative configuration of the ExtensionReference type for use with @@ -40,7 +40,7 @@ func ExtensionReference() *ExtensionReferenceApplyConfiguration { // WithGroup sets the Group 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 Group field is set to the value of the last call. -func (b *ExtensionReferenceApplyConfiguration) WithGroup(value apiv1alpha2.Group) *ExtensionReferenceApplyConfiguration { +func (b *ExtensionReferenceApplyConfiguration) WithGroup(value apixv1alpha2.Group) *ExtensionReferenceApplyConfiguration { b.Group = &value return b } @@ -48,7 +48,7 @@ func (b *ExtensionReferenceApplyConfiguration) WithGroup(value apiv1alpha2.Group // 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 *ExtensionReferenceApplyConfiguration) WithKind(value apiv1alpha2.Kind) *ExtensionReferenceApplyConfiguration { +func (b *ExtensionReferenceApplyConfiguration) WithKind(value apixv1alpha2.Kind) *ExtensionReferenceApplyConfiguration { b.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *ExtensionReferenceApplyConfiguration) WithKind(value apiv1alpha2.Kind) // 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 *ExtensionReferenceApplyConfiguration) WithName(value apiv1alpha2.ObjectName) *ExtensionReferenceApplyConfiguration { +func (b *ExtensionReferenceApplyConfiguration) WithName(value apixv1alpha2.ObjectName) *ExtensionReferenceApplyConfiguration { b.Name = &value return b } @@ -64,7 +64,7 @@ func (b *ExtensionReferenceApplyConfiguration) WithName(value apiv1alpha2.Object // WithPortNumber sets the PortNumber 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 PortNumber field is set to the value of the last call. -func (b *ExtensionReferenceApplyConfiguration) WithPortNumber(value apiv1alpha2.PortNumber) *ExtensionReferenceApplyConfiguration { +func (b *ExtensionReferenceApplyConfiguration) WithPortNumber(value apixv1alpha2.PortNumber) *ExtensionReferenceApplyConfiguration { b.PortNumber = &value return b } diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencemodel.go b/client-go/applyconfiguration/apix/v1alpha2/inferencemodel.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/inferencemodel.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencemodel.go diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencemodelspec.go b/client-go/applyconfiguration/apix/v1alpha2/inferencemodelspec.go similarity index 93% rename from client-go/applyconfiguration/api/v1alpha2/inferencemodelspec.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencemodelspec.go index 2fea0a354..0fb5bd8dd 100644 --- a/client-go/applyconfiguration/api/v1alpha2/inferencemodelspec.go +++ b/client-go/applyconfiguration/apix/v1alpha2/inferencemodelspec.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // InferenceModelSpecApplyConfiguration represents a declarative configuration of the InferenceModelSpec type for use // with apply. type InferenceModelSpecApplyConfiguration struct { ModelName *string `json:"modelName,omitempty"` - Criticality *apiv1alpha2.Criticality `json:"criticality,omitempty"` + Criticality *apixv1alpha2.Criticality `json:"criticality,omitempty"` TargetModels []TargetModelApplyConfiguration `json:"targetModels,omitempty"` PoolRef *PoolObjectReferenceApplyConfiguration `json:"poolRef,omitempty"` } @@ -48,7 +48,7 @@ func (b *InferenceModelSpecApplyConfiguration) WithModelName(value string) *Infe // WithCriticality sets the Criticality 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 Criticality field is set to the value of the last call. -func (b *InferenceModelSpecApplyConfiguration) WithCriticality(value apiv1alpha2.Criticality) *InferenceModelSpecApplyConfiguration { +func (b *InferenceModelSpecApplyConfiguration) WithCriticality(value apixv1alpha2.Criticality) *InferenceModelSpecApplyConfiguration { b.Criticality = &value return b } diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencemodelstatus.go b/client-go/applyconfiguration/apix/v1alpha2/inferencemodelstatus.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/inferencemodelstatus.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencemodelstatus.go diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencepool.go b/client-go/applyconfiguration/apix/v1alpha2/inferencepool.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/inferencepool.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencepool.go diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencepoolspec.go b/client-go/applyconfiguration/apix/v1alpha2/inferencepoolspec.go similarity index 86% rename from client-go/applyconfiguration/api/v1alpha2/inferencepoolspec.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencepoolspec.go index fd6683102..8773d9c03 100644 --- a/client-go/applyconfiguration/api/v1alpha2/inferencepoolspec.go +++ b/client-go/applyconfiguration/apix/v1alpha2/inferencepoolspec.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // InferencePoolSpecApplyConfiguration represents a declarative configuration of the InferencePoolSpec type for use // with apply. type InferencePoolSpecApplyConfiguration struct { - Selector map[apiv1alpha2.LabelKey]apiv1alpha2.LabelValue `json:"selector,omitempty"` - TargetPortNumber *int32 `json:"targetPortNumber,omitempty"` + Selector map[apixv1alpha2.LabelKey]apixv1alpha2.LabelValue `json:"selector,omitempty"` + TargetPortNumber *int32 `json:"targetPortNumber,omitempty"` EndpointPickerConfigApplyConfiguration `json:",inline"` } @@ -40,9 +40,9 @@ func InferencePoolSpec() *InferencePoolSpecApplyConfiguration { // 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 Selector field, // overwriting an existing map entries in Selector field with the same key. -func (b *InferencePoolSpecApplyConfiguration) WithSelector(entries map[apiv1alpha2.LabelKey]apiv1alpha2.LabelValue) *InferencePoolSpecApplyConfiguration { +func (b *InferencePoolSpecApplyConfiguration) WithSelector(entries map[apixv1alpha2.LabelKey]apixv1alpha2.LabelValue) *InferencePoolSpecApplyConfiguration { if b.Selector == nil && len(entries) > 0 { - b.Selector = make(map[apiv1alpha2.LabelKey]apiv1alpha2.LabelValue, len(entries)) + b.Selector = make(map[apixv1alpha2.LabelKey]apixv1alpha2.LabelValue, len(entries)) } for k, v := range entries { b.Selector[k] = v diff --git a/client-go/applyconfiguration/api/v1alpha2/inferencepoolstatus.go b/client-go/applyconfiguration/apix/v1alpha2/inferencepoolstatus.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/inferencepoolstatus.go rename to client-go/applyconfiguration/apix/v1alpha2/inferencepoolstatus.go diff --git a/client-go/applyconfiguration/api/v1alpha2/parentgatewayreference.go b/client-go/applyconfiguration/apix/v1alpha2/parentgatewayreference.go similarity index 81% rename from client-go/applyconfiguration/api/v1alpha2/parentgatewayreference.go rename to client-go/applyconfiguration/apix/v1alpha2/parentgatewayreference.go index a003b8a68..dd02dcadb 100644 --- a/client-go/applyconfiguration/api/v1alpha2/parentgatewayreference.go +++ b/client-go/applyconfiguration/apix/v1alpha2/parentgatewayreference.go @@ -19,16 +19,16 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // ParentGatewayReferenceApplyConfiguration represents a declarative configuration of the ParentGatewayReference type for use // with apply. type ParentGatewayReferenceApplyConfiguration struct { - Group *apiv1alpha2.Group `json:"group,omitempty"` - Kind *apiv1alpha2.Kind `json:"kind,omitempty"` - Name *apiv1alpha2.ObjectName `json:"name,omitempty"` - Namespace *apiv1alpha2.Namespace `json:"namespace,omitempty"` + Group *apixv1alpha2.Group `json:"group,omitempty"` + Kind *apixv1alpha2.Kind `json:"kind,omitempty"` + Name *apixv1alpha2.ObjectName `json:"name,omitempty"` + Namespace *apixv1alpha2.Namespace `json:"namespace,omitempty"` } // ParentGatewayReferenceApplyConfiguration constructs a declarative configuration of the ParentGatewayReference type for use with @@ -40,7 +40,7 @@ func ParentGatewayReference() *ParentGatewayReferenceApplyConfiguration { // WithGroup sets the Group 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 Group field is set to the value of the last call. -func (b *ParentGatewayReferenceApplyConfiguration) WithGroup(value apiv1alpha2.Group) *ParentGatewayReferenceApplyConfiguration { +func (b *ParentGatewayReferenceApplyConfiguration) WithGroup(value apixv1alpha2.Group) *ParentGatewayReferenceApplyConfiguration { b.Group = &value return b } @@ -48,7 +48,7 @@ func (b *ParentGatewayReferenceApplyConfiguration) WithGroup(value apiv1alpha2.G // 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 *ParentGatewayReferenceApplyConfiguration) WithKind(value apiv1alpha2.Kind) *ParentGatewayReferenceApplyConfiguration { +func (b *ParentGatewayReferenceApplyConfiguration) WithKind(value apixv1alpha2.Kind) *ParentGatewayReferenceApplyConfiguration { b.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *ParentGatewayReferenceApplyConfiguration) WithKind(value apiv1alpha2.Ki // 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 *ParentGatewayReferenceApplyConfiguration) WithName(value apiv1alpha2.ObjectName) *ParentGatewayReferenceApplyConfiguration { +func (b *ParentGatewayReferenceApplyConfiguration) WithName(value apixv1alpha2.ObjectName) *ParentGatewayReferenceApplyConfiguration { b.Name = &value return b } @@ -64,7 +64,7 @@ func (b *ParentGatewayReferenceApplyConfiguration) WithName(value apiv1alpha2.Ob // 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 *ParentGatewayReferenceApplyConfiguration) WithNamespace(value apiv1alpha2.Namespace) *ParentGatewayReferenceApplyConfiguration { +func (b *ParentGatewayReferenceApplyConfiguration) WithNamespace(value apixv1alpha2.Namespace) *ParentGatewayReferenceApplyConfiguration { b.Namespace = &value return b } diff --git a/client-go/applyconfiguration/api/v1alpha2/poolobjectreference.go b/client-go/applyconfiguration/apix/v1alpha2/poolobjectreference.go similarity index 83% rename from client-go/applyconfiguration/api/v1alpha2/poolobjectreference.go rename to client-go/applyconfiguration/apix/v1alpha2/poolobjectreference.go index 289458866..0a08b89bd 100644 --- a/client-go/applyconfiguration/api/v1alpha2/poolobjectreference.go +++ b/client-go/applyconfiguration/apix/v1alpha2/poolobjectreference.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha2 import ( - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // PoolObjectReferenceApplyConfiguration represents a declarative configuration of the PoolObjectReference type for use // with apply. type PoolObjectReferenceApplyConfiguration struct { - Group *apiv1alpha2.Group `json:"group,omitempty"` - Kind *apiv1alpha2.Kind `json:"kind,omitempty"` - Name *apiv1alpha2.ObjectName `json:"name,omitempty"` + Group *apixv1alpha2.Group `json:"group,omitempty"` + Kind *apixv1alpha2.Kind `json:"kind,omitempty"` + Name *apixv1alpha2.ObjectName `json:"name,omitempty"` } // PoolObjectReferenceApplyConfiguration constructs a declarative configuration of the PoolObjectReference type for use with @@ -39,7 +39,7 @@ func PoolObjectReference() *PoolObjectReferenceApplyConfiguration { // WithGroup sets the Group 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 Group field is set to the value of the last call. -func (b *PoolObjectReferenceApplyConfiguration) WithGroup(value apiv1alpha2.Group) *PoolObjectReferenceApplyConfiguration { +func (b *PoolObjectReferenceApplyConfiguration) WithGroup(value apixv1alpha2.Group) *PoolObjectReferenceApplyConfiguration { b.Group = &value return b } @@ -47,7 +47,7 @@ func (b *PoolObjectReferenceApplyConfiguration) WithGroup(value apiv1alpha2.Grou // 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 *PoolObjectReferenceApplyConfiguration) WithKind(value apiv1alpha2.Kind) *PoolObjectReferenceApplyConfiguration { +func (b *PoolObjectReferenceApplyConfiguration) WithKind(value apixv1alpha2.Kind) *PoolObjectReferenceApplyConfiguration { b.Kind = &value return b } @@ -55,7 +55,7 @@ func (b *PoolObjectReferenceApplyConfiguration) WithKind(value apiv1alpha2.Kind) // 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 *PoolObjectReferenceApplyConfiguration) WithName(value apiv1alpha2.ObjectName) *PoolObjectReferenceApplyConfiguration { +func (b *PoolObjectReferenceApplyConfiguration) WithName(value apixv1alpha2.ObjectName) *PoolObjectReferenceApplyConfiguration { b.Name = &value return b } diff --git a/client-go/applyconfiguration/api/v1alpha2/poolstatus.go b/client-go/applyconfiguration/apix/v1alpha2/poolstatus.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/poolstatus.go rename to client-go/applyconfiguration/apix/v1alpha2/poolstatus.go diff --git a/client-go/applyconfiguration/api/v1alpha2/targetmodel.go b/client-go/applyconfiguration/apix/v1alpha2/targetmodel.go similarity index 100% rename from client-go/applyconfiguration/api/v1alpha2/targetmodel.go rename to client-go/applyconfiguration/apix/v1alpha2/targetmodel.go diff --git a/client-go/applyconfiguration/utils.go b/client-go/applyconfiguration/utils.go index ea204cd33..bdcbad045 100644 --- a/client-go/applyconfiguration/utils.go +++ b/client-go/applyconfiguration/utils.go @@ -22,8 +22,10 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1alpha2" + v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1" + 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" ) @@ -31,35 +33,55 @@ import ( // apply configuration type exists for the given GroupVersionKind. func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { - // Group=inference.networking.x-k8s.io, Version=v1alpha2 + // Group=inference.networking.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("EndpointPickerConfig"): + return &apiv1.EndpointPickerConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Extension"): + return &apiv1.ExtensionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ExtensionConnection"): + return &apiv1.ExtensionConnectionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ExtensionReference"): + return &apiv1.ExtensionReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InferencePool"): + return &apiv1.InferencePoolApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InferencePoolSpec"): + return &apiv1.InferencePoolSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InferencePoolStatus"): + return &apiv1.InferencePoolStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ParentGatewayReference"): + return &apiv1.ParentGatewayReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PoolStatus"): + return &apiv1.PoolStatusApplyConfiguration{} + + // Group=inference.networking.x-k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithKind("EndpointPickerConfig"): - return &apiv1alpha2.EndpointPickerConfigApplyConfiguration{} + return &apixv1alpha2.EndpointPickerConfigApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("Extension"): - return &apiv1alpha2.ExtensionApplyConfiguration{} + return &apixv1alpha2.ExtensionApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ExtensionConnection"): - return &apiv1alpha2.ExtensionConnectionApplyConfiguration{} + return &apixv1alpha2.ExtensionConnectionApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ExtensionReference"): - return &apiv1alpha2.ExtensionReferenceApplyConfiguration{} + return &apixv1alpha2.ExtensionReferenceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferenceModel"): - return &apiv1alpha2.InferenceModelApplyConfiguration{} + return &apixv1alpha2.InferenceModelApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferenceModelSpec"): - return &apiv1alpha2.InferenceModelSpecApplyConfiguration{} + return &apixv1alpha2.InferenceModelSpecApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferenceModelStatus"): - return &apiv1alpha2.InferenceModelStatusApplyConfiguration{} + return &apixv1alpha2.InferenceModelStatusApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferencePool"): - return &apiv1alpha2.InferencePoolApplyConfiguration{} + return &apixv1alpha2.InferencePoolApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferencePoolSpec"): - return &apiv1alpha2.InferencePoolSpecApplyConfiguration{} + return &apixv1alpha2.InferencePoolSpecApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("InferencePoolStatus"): - return &apiv1alpha2.InferencePoolStatusApplyConfiguration{} + return &apixv1alpha2.InferencePoolStatusApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ParentGatewayReference"): - return &apiv1alpha2.ParentGatewayReferenceApplyConfiguration{} + return &apixv1alpha2.ParentGatewayReferenceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PoolObjectReference"): - return &apiv1alpha2.PoolObjectReferenceApplyConfiguration{} + return &apixv1alpha2.PoolObjectReferenceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PoolStatus"): - return &apiv1alpha2.PoolStatusApplyConfiguration{} + return &apixv1alpha2.PoolStatusApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("TargetModel"): - return &apiv1alpha2.TargetModelApplyConfiguration{} + return &apixv1alpha2.TargetModelApplyConfiguration{} } return nil diff --git a/client-go/clientset/versioned/clientset.go b/client-go/clientset/versioned/clientset.go index 653aa0461..928ab89f1 100644 --- a/client-go/clientset/versioned/clientset.go +++ b/client-go/clientset/versioned/clientset.go @@ -25,23 +25,31 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" - inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2" + inferencev1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1" + xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" ) type Interface interface { Discovery() discovery.DiscoveryInterface - InferenceV1alpha2() inferencev1alpha2.InferenceV1alpha2Interface + InferenceV1() inferencev1.InferenceV1Interface + XInferenceV1alpha2() xinferencev1alpha2.XInferenceV1alpha2Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient - inferenceV1alpha2 *inferencev1alpha2.InferenceV1alpha2Client + inferenceV1 *inferencev1.InferenceV1Client + xInferenceV1alpha2 *xinferencev1alpha2.XInferenceV1alpha2Client } -// InferenceV1alpha2 retrieves the InferenceV1alpha2Client -func (c *Clientset) InferenceV1alpha2() inferencev1alpha2.InferenceV1alpha2Interface { - return c.inferenceV1alpha2 +// InferenceV1 retrieves the InferenceV1Client +func (c *Clientset) InferenceV1() inferencev1.InferenceV1Interface { + return c.inferenceV1 +} + +// XInferenceV1alpha2 retrieves the XInferenceV1alpha2Client +func (c *Clientset) XInferenceV1alpha2() xinferencev1alpha2.XInferenceV1alpha2Interface { + return c.xInferenceV1alpha2 } // Discovery retrieves the DiscoveryClient @@ -88,7 +96,11 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error - cs.inferenceV1alpha2, err = inferencev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.inferenceV1, err = inferencev1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.xInferenceV1alpha2, err = xinferencev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -113,7 +125,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.inferenceV1alpha2 = inferencev1alpha2.New(c) + cs.inferenceV1 = inferencev1.New(c) + cs.xInferenceV1alpha2 = xinferencev1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/client-go/clientset/versioned/fake/clientset_generated.go b/client-go/clientset/versioned/fake/clientset_generated.go index a78153b43..5a400590d 100644 --- a/client-go/clientset/versioned/fake/clientset_generated.go +++ b/client-go/clientset/versioned/fake/clientset_generated.go @@ -27,8 +27,10 @@ import ( "k8s.io/client-go/testing" applyconfiguration "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration" clientset "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned" - inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2" - fakeinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2/fake" + 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" + 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" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -125,7 +127,12 @@ var ( _ testing.FakeClient = &Clientset{} ) -// InferenceV1alpha2 retrieves the InferenceV1alpha2Client -func (c *Clientset) InferenceV1alpha2() inferencev1alpha2.InferenceV1alpha2Interface { - return &fakeinferencev1alpha2.FakeInferenceV1alpha2{Fake: &c.Fake} +// InferenceV1 retrieves the InferenceV1Client +func (c *Clientset) InferenceV1() inferencev1.InferenceV1Interface { + return &fakeinferencev1.FakeInferenceV1{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 c9b917d62..5c6d338ce 100644 --- a/client-go/clientset/versioned/fake/register.go +++ b/client-go/clientset/versioned/fake/register.go @@ -24,14 +24,16 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + inferencev1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - inferencev1alpha2.AddToScheme, + inferencev1.AddToScheme, + xinferencev1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/client-go/clientset/versioned/scheme/register.go b/client-go/clientset/versioned/scheme/register.go index 1566a730b..7836df4f5 100644 --- a/client-go/clientset/versioned/scheme/register.go +++ b/client-go/clientset/versioned/scheme/register.go @@ -24,14 +24,16 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + inferencev1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + xinferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - inferencev1alpha2.AddToScheme, + inferencev1.AddToScheme, + xinferencev1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/client-go/clientset/versioned/typed/api/v1/api_client.go b/client-go/clientset/versioned/typed/api/v1/api_client.go new file mode 100644 index 000000000..4d33e59e5 --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/api_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 v1 + +import ( + http "net/http" + + rest "k8s.io/client-go/rest" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" +) + +type InferenceV1Interface interface { + RESTClient() rest.Interface + InferencePoolsGetter +} + +// InferenceV1Client is used to interact with features provided by the inference.networking.k8s.io group. +type InferenceV1Client struct { + restClient rest.Interface +} + +func (c *InferenceV1Client) InferencePools(namespace string) InferencePoolInterface { + return newInferencePools(c, namespace) +} + +// NewForConfig creates a new InferenceV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*InferenceV1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new InferenceV1Client 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) (*InferenceV1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &InferenceV1Client{client}, nil +} + +// NewForConfigOrDie creates a new InferenceV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *InferenceV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new InferenceV1Client for the given RESTClient. +func New(c rest.Interface) *InferenceV1Client { + return &InferenceV1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := apiv1.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 *InferenceV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client-go/clientset/versioned/typed/api/v1/doc.go b/client-go/clientset/versioned/typed/api/v1/doc.go new file mode 100644 index 000000000..3af5d054f --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/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 v1 diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/fake/doc.go b/client-go/clientset/versioned/typed/api/v1/fake/doc.go similarity index 100% rename from client-go/clientset/versioned/typed/api/v1alpha2/fake/doc.go rename to client-go/clientset/versioned/typed/api/v1/fake/doc.go diff --git a/client-go/clientset/versioned/typed/api/v1/fake/fake_api_client.go b/client-go/clientset/versioned/typed/api/v1/fake/fake_api_client.go new file mode 100644 index 000000000..c9a3b9f67 --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/fake/fake_api_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" + v1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1" +) + +type FakeInferenceV1 struct { + *testing.Fake +} + +func (c *FakeInferenceV1) InferencePools(namespace string) v1.InferencePoolInterface { + return newFakeInferencePools(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeInferenceV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client-go/clientset/versioned/typed/api/v1/fake/fake_inferencepool.go b/client-go/clientset/versioned/typed/api/v1/fake/fake_inferencepool.go new file mode 100644 index 000000000..a0f0f2b39 --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/fake/fake_inferencepool.go @@ -0,0 +1,51 @@ +/* +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" + v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1" + typedapiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1" +) + +// fakeInferencePools implements InferencePoolInterface +type fakeInferencePools struct { + *gentype.FakeClientWithListAndApply[*v1.InferencePool, *v1.InferencePoolList, *apiv1.InferencePoolApplyConfiguration] + Fake *FakeInferenceV1 +} + +func newFakeInferencePools(fake *FakeInferenceV1, namespace string) typedapiv1.InferencePoolInterface { + return &fakeInferencePools{ + gentype.NewFakeClientWithListAndApply[*v1.InferencePool, *v1.InferencePoolList, *apiv1.InferencePoolApplyConfiguration]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("inferencepools"), + v1.SchemeGroupVersion.WithKind("InferencePool"), + func() *v1.InferencePool { return &v1.InferencePool{} }, + func() *v1.InferencePoolList { return &v1.InferencePoolList{} }, + func(dst, src *v1.InferencePoolList) { dst.ListMeta = src.ListMeta }, + func(list *v1.InferencePoolList) []*v1.InferencePool { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.InferencePoolList, items []*v1.InferencePool) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/client-go/clientset/versioned/typed/api/v1/generated_expansion.go b/client-go/clientset/versioned/typed/api/v1/generated_expansion.go new file mode 100644 index 000000000..33a136b75 --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/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 v1 + +type InferencePoolExpansion interface{} diff --git a/client-go/clientset/versioned/typed/api/v1/inferencepool.go b/client-go/clientset/versioned/typed/api/v1/inferencepool.go new file mode 100644 index 000000000..649b06743 --- /dev/null +++ b/client-go/clientset/versioned/typed/api/v1/inferencepool.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 v1 + +import ( + context "context" + + metav1 "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" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + applyconfigurationapiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1" + scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" +) + +// InferencePoolsGetter has a method to return a InferencePoolInterface. +// A group's client should implement this interface. +type InferencePoolsGetter interface { + InferencePools(namespace string) InferencePoolInterface +} + +// InferencePoolInterface has methods to work with InferencePool resources. +type InferencePoolInterface interface { + Create(ctx context.Context, inferencePool *apiv1.InferencePool, opts metav1.CreateOptions) (*apiv1.InferencePool, error) + Update(ctx context.Context, inferencePool *apiv1.InferencePool, opts metav1.UpdateOptions) (*apiv1.InferencePool, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inferencePool *apiv1.InferencePool, opts metav1.UpdateOptions) (*apiv1.InferencePool, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*apiv1.InferencePool, error) + List(ctx context.Context, opts metav1.ListOptions) (*apiv1.InferencePoolList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *apiv1.InferencePool, err error) + Apply(ctx context.Context, inferencePool *applyconfigurationapiv1.InferencePoolApplyConfiguration, opts metav1.ApplyOptions) (result *apiv1.InferencePool, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inferencePool *applyconfigurationapiv1.InferencePoolApplyConfiguration, opts metav1.ApplyOptions) (result *apiv1.InferencePool, err error) + InferencePoolExpansion +} + +// inferencePools implements InferencePoolInterface +type inferencePools struct { + *gentype.ClientWithListAndApply[*apiv1.InferencePool, *apiv1.InferencePoolList, *applyconfigurationapiv1.InferencePoolApplyConfiguration] +} + +// newInferencePools returns a InferencePools +func newInferencePools(c *InferenceV1Client, namespace string) *inferencePools { + return &inferencePools{ + gentype.NewClientWithListAndApply[*apiv1.InferencePool, *apiv1.InferencePoolList, *applyconfigurationapiv1.InferencePoolApplyConfiguration]( + "inferencepools", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1.InferencePool { return &apiv1.InferencePool{} }, + func() *apiv1.InferencePoolList { return &apiv1.InferencePoolList{} }, + ), + } +} diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/api_client.go b/client-go/clientset/versioned/typed/apix/v1alpha2/apix_client.go similarity index 62% rename from client-go/clientset/versioned/typed/api/v1alpha2/api_client.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/apix_client.go index 80b3ecfd8..52e4007cf 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/api_client.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/apix_client.go @@ -22,33 +22,33 @@ import ( http "net/http" rest "k8s.io/client-go/rest" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" ) -type InferenceV1alpha2Interface interface { +type XInferenceV1alpha2Interface interface { RESTClient() rest.Interface InferenceModelsGetter InferencePoolsGetter } -// InferenceV1alpha2Client is used to interact with features provided by the inference.networking.x-k8s.io group. -type InferenceV1alpha2Client struct { +// XInferenceV1alpha2Client is used to interact with features provided by the inference.networking.x-k8s.io group. +type XInferenceV1alpha2Client struct { restClient rest.Interface } -func (c *InferenceV1alpha2Client) InferenceModels(namespace string) InferenceModelInterface { +func (c *XInferenceV1alpha2Client) InferenceModels(namespace string) InferenceModelInterface { return newInferenceModels(c, namespace) } -func (c *InferenceV1alpha2Client) InferencePools(namespace string) InferencePoolInterface { +func (c *XInferenceV1alpha2Client) InferencePools(namespace string) InferencePoolInterface { return newInferencePools(c, namespace) } -// NewForConfig creates a new InferenceV1alpha2Client for the given config. +// NewForConfig creates a new XInferenceV1alpha2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*InferenceV1alpha2Client, error) { +func NewForConfig(c *rest.Config) (*XInferenceV1alpha2Client, error) { config := *c setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) @@ -58,21 +58,21 @@ func NewForConfig(c *rest.Config) (*InferenceV1alpha2Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new InferenceV1alpha2Client for the given config and http client. +// NewForConfigAndClient creates a new XInferenceV1alpha2Client 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) (*InferenceV1alpha2Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*XInferenceV1alpha2Client, error) { config := *c setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } - return &InferenceV1alpha2Client{client}, nil + return &XInferenceV1alpha2Client{client}, nil } -// NewForConfigOrDie creates a new InferenceV1alpha2Client for the given config and +// NewForConfigOrDie creates a new XInferenceV1alpha2Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *InferenceV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *XInferenceV1alpha2Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -80,13 +80,13 @@ func NewForConfigOrDie(c *rest.Config) *InferenceV1alpha2Client { return client } -// New creates a new InferenceV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *InferenceV1alpha2Client { - return &InferenceV1alpha2Client{c} +// New creates a new XInferenceV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *XInferenceV1alpha2Client { + return &XInferenceV1alpha2Client{c} } func setConfigDefaults(config *rest.Config) { - gv := apiv1alpha2.SchemeGroupVersion + gv := apixv1alpha2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() @@ -98,7 +98,7 @@ func setConfigDefaults(config *rest.Config) { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *InferenceV1alpha2Client) RESTClient() rest.Interface { +func (c *XInferenceV1alpha2Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/doc.go b/client-go/clientset/versioned/typed/apix/v1alpha2/doc.go similarity index 100% rename from client-go/clientset/versioned/typed/api/v1alpha2/doc.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/doc.go diff --git a/client-go/clientset/versioned/typed/apix/v1alpha2/fake/doc.go b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/doc.go new file mode 100644 index 000000000..16f443990 --- /dev/null +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/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/api/v1alpha2/fake/fake_api_client.go b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_apix_client.go similarity index 75% rename from client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_api_client.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_apix_client.go index 14fcc20cf..199a2cafd 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_api_client.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_apix_client.go @@ -21,24 +21,24 @@ package fake import ( rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" ) -type FakeInferenceV1alpha2 struct { +type FakeXInferenceV1alpha2 struct { *testing.Fake } -func (c *FakeInferenceV1alpha2) InferenceModels(namespace string) v1alpha2.InferenceModelInterface { +func (c *FakeXInferenceV1alpha2) InferenceModels(namespace string) v1alpha2.InferenceModelInterface { return newFakeInferenceModels(c, namespace) } -func (c *FakeInferenceV1alpha2) InferencePools(namespace string) v1alpha2.InferencePoolInterface { +func (c *FakeXInferenceV1alpha2) InferencePools(namespace string) v1alpha2.InferencePoolInterface { return newFakeInferencePools(c, namespace) } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeInferenceV1alpha2) RESTClient() rest.Interface { +func (c *FakeXInferenceV1alpha2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencemodel.go b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencemodel.go similarity index 72% rename from client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencemodel.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencemodel.go index 93c11b5e8..6a9c3e936 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencemodel.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencemodel.go @@ -20,20 +20,20 @@ package fake import ( gentype "k8s.io/client-go/gentype" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1alpha2" - typedapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha2" + typedapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" ) // fakeInferenceModels implements InferenceModelInterface type fakeInferenceModels struct { - *gentype.FakeClientWithListAndApply[*v1alpha2.InferenceModel, *v1alpha2.InferenceModelList, *apiv1alpha2.InferenceModelApplyConfiguration] - Fake *FakeInferenceV1alpha2 + *gentype.FakeClientWithListAndApply[*v1alpha2.InferenceModel, *v1alpha2.InferenceModelList, *apixv1alpha2.InferenceModelApplyConfiguration] + Fake *FakeXInferenceV1alpha2 } -func newFakeInferenceModels(fake *FakeInferenceV1alpha2, namespace string) typedapiv1alpha2.InferenceModelInterface { +func newFakeInferenceModels(fake *FakeXInferenceV1alpha2, namespace string) typedapixv1alpha2.InferenceModelInterface { return &fakeInferenceModels{ - gentype.NewFakeClientWithListAndApply[*v1alpha2.InferenceModel, *v1alpha2.InferenceModelList, *apiv1alpha2.InferenceModelApplyConfiguration]( + gentype.NewFakeClientWithListAndApply[*v1alpha2.InferenceModel, *v1alpha2.InferenceModelList, *apixv1alpha2.InferenceModelApplyConfiguration]( fake.Fake, namespace, v1alpha2.SchemeGroupVersion.WithResource("inferencemodels"), diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencepool.go b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencepool.go similarity index 72% rename from client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencepool.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencepool.go index df8222c4f..46c6163fd 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/fake/fake_inferencepool.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/fake/fake_inferencepool.go @@ -20,20 +20,20 @@ package fake import ( gentype "k8s.io/client-go/gentype" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1alpha2" - typedapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/api/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha2" + typedapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/typed/apix/v1alpha2" ) // fakeInferencePools implements InferencePoolInterface type fakeInferencePools struct { - *gentype.FakeClientWithListAndApply[*v1alpha2.InferencePool, *v1alpha2.InferencePoolList, *apiv1alpha2.InferencePoolApplyConfiguration] - Fake *FakeInferenceV1alpha2 + *gentype.FakeClientWithListAndApply[*v1alpha2.InferencePool, *v1alpha2.InferencePoolList, *apixv1alpha2.InferencePoolApplyConfiguration] + Fake *FakeXInferenceV1alpha2 } -func newFakeInferencePools(fake *FakeInferenceV1alpha2, namespace string) typedapiv1alpha2.InferencePoolInterface { +func newFakeInferencePools(fake *FakeXInferenceV1alpha2, namespace string) typedapixv1alpha2.InferencePoolInterface { return &fakeInferencePools{ - gentype.NewFakeClientWithListAndApply[*v1alpha2.InferencePool, *v1alpha2.InferencePoolList, *apiv1alpha2.InferencePoolApplyConfiguration]( + gentype.NewFakeClientWithListAndApply[*v1alpha2.InferencePool, *v1alpha2.InferencePoolList, *apixv1alpha2.InferencePoolApplyConfiguration]( fake.Fake, namespace, v1alpha2.SchemeGroupVersion.WithResource("inferencepools"), diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/generated_expansion.go b/client-go/clientset/versioned/typed/apix/v1alpha2/generated_expansion.go similarity index 100% rename from client-go/clientset/versioned/typed/api/v1alpha2/generated_expansion.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/generated_expansion.go diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/inferencemodel.go b/client-go/clientset/versioned/typed/apix/v1alpha2/inferencemodel.go similarity index 58% rename from client-go/clientset/versioned/typed/api/v1alpha2/inferencemodel.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/inferencemodel.go index 5671668d8..efe312d4d 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/inferencemodel.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/inferencemodel.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" - applyconfigurationapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" + applyconfigurationapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha2" scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" ) @@ -38,37 +38,37 @@ type InferenceModelsGetter interface { // InferenceModelInterface has methods to work with InferenceModel resources. type InferenceModelInterface interface { - Create(ctx context.Context, inferenceModel *apiv1alpha2.InferenceModel, opts v1.CreateOptions) (*apiv1alpha2.InferenceModel, error) - Update(ctx context.Context, inferenceModel *apiv1alpha2.InferenceModel, opts v1.UpdateOptions) (*apiv1alpha2.InferenceModel, error) + Create(ctx context.Context, inferenceModel *apixv1alpha2.InferenceModel, opts v1.CreateOptions) (*apixv1alpha2.InferenceModel, error) + Update(ctx context.Context, inferenceModel *apixv1alpha2.InferenceModel, opts v1.UpdateOptions) (*apixv1alpha2.InferenceModel, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, inferenceModel *apiv1alpha2.InferenceModel, opts v1.UpdateOptions) (*apiv1alpha2.InferenceModel, error) + UpdateStatus(ctx context.Context, inferenceModel *apixv1alpha2.InferenceModel, opts v1.UpdateOptions) (*apixv1alpha2.InferenceModel, 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) (*apiv1alpha2.InferenceModel, error) - List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha2.InferenceModelList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*apixv1alpha2.InferenceModel, error) + List(ctx context.Context, opts v1.ListOptions) (*apixv1alpha2.InferenceModelList, 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 *apiv1alpha2.InferenceModel, err error) - Apply(ctx context.Context, inferenceModel *applyconfigurationapiv1alpha2.InferenceModelApplyConfiguration, opts v1.ApplyOptions) (result *apiv1alpha2.InferenceModel, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apixv1alpha2.InferenceModel, err error) + Apply(ctx context.Context, inferenceModel *applyconfigurationapixv1alpha2.InferenceModelApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha2.InferenceModel, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, inferenceModel *applyconfigurationapiv1alpha2.InferenceModelApplyConfiguration, opts v1.ApplyOptions) (result *apiv1alpha2.InferenceModel, err error) + ApplyStatus(ctx context.Context, inferenceModel *applyconfigurationapixv1alpha2.InferenceModelApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha2.InferenceModel, err error) InferenceModelExpansion } // inferenceModels implements InferenceModelInterface type inferenceModels struct { - *gentype.ClientWithListAndApply[*apiv1alpha2.InferenceModel, *apiv1alpha2.InferenceModelList, *applyconfigurationapiv1alpha2.InferenceModelApplyConfiguration] + *gentype.ClientWithListAndApply[*apixv1alpha2.InferenceModel, *apixv1alpha2.InferenceModelList, *applyconfigurationapixv1alpha2.InferenceModelApplyConfiguration] } // newInferenceModels returns a InferenceModels -func newInferenceModels(c *InferenceV1alpha2Client, namespace string) *inferenceModels { +func newInferenceModels(c *XInferenceV1alpha2Client, namespace string) *inferenceModels { return &inferenceModels{ - gentype.NewClientWithListAndApply[*apiv1alpha2.InferenceModel, *apiv1alpha2.InferenceModelList, *applyconfigurationapiv1alpha2.InferenceModelApplyConfiguration]( + gentype.NewClientWithListAndApply[*apixv1alpha2.InferenceModel, *apixv1alpha2.InferenceModelList, *applyconfigurationapixv1alpha2.InferenceModelApplyConfiguration]( "inferencemodels", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *apiv1alpha2.InferenceModel { return &apiv1alpha2.InferenceModel{} }, - func() *apiv1alpha2.InferenceModelList { return &apiv1alpha2.InferenceModelList{} }, + func() *apixv1alpha2.InferenceModel { return &apixv1alpha2.InferenceModel{} }, + func() *apixv1alpha2.InferenceModelList { return &apixv1alpha2.InferenceModelList{} }, ), } } diff --git a/client-go/clientset/versioned/typed/api/v1alpha2/inferencepool.go b/client-go/clientset/versioned/typed/apix/v1alpha2/inferencepool.go similarity index 58% rename from client-go/clientset/versioned/typed/api/v1alpha2/inferencepool.go rename to client-go/clientset/versioned/typed/apix/v1alpha2/inferencepool.go index ac0616c7c..f8f8ae698 100644 --- a/client-go/clientset/versioned/typed/api/v1alpha2/inferencepool.go +++ b/client-go/clientset/versioned/typed/apix/v1alpha2/inferencepool.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" - applyconfigurationapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" + applyconfigurationapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/apix/v1alpha2" scheme "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned/scheme" ) @@ -38,37 +38,37 @@ type InferencePoolsGetter interface { // InferencePoolInterface has methods to work with InferencePool resources. type InferencePoolInterface interface { - Create(ctx context.Context, inferencePool *apiv1alpha2.InferencePool, opts v1.CreateOptions) (*apiv1alpha2.InferencePool, error) - Update(ctx context.Context, inferencePool *apiv1alpha2.InferencePool, opts v1.UpdateOptions) (*apiv1alpha2.InferencePool, error) + Create(ctx context.Context, inferencePool *apixv1alpha2.InferencePool, opts v1.CreateOptions) (*apixv1alpha2.InferencePool, error) + Update(ctx context.Context, inferencePool *apixv1alpha2.InferencePool, opts v1.UpdateOptions) (*apixv1alpha2.InferencePool, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, inferencePool *apiv1alpha2.InferencePool, opts v1.UpdateOptions) (*apiv1alpha2.InferencePool, error) + UpdateStatus(ctx context.Context, inferencePool *apixv1alpha2.InferencePool, opts v1.UpdateOptions) (*apixv1alpha2.InferencePool, 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) (*apiv1alpha2.InferencePool, error) - List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha2.InferencePoolList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*apixv1alpha2.InferencePool, error) + List(ctx context.Context, opts v1.ListOptions) (*apixv1alpha2.InferencePoolList, 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 *apiv1alpha2.InferencePool, err error) - Apply(ctx context.Context, inferencePool *applyconfigurationapiv1alpha2.InferencePoolApplyConfiguration, opts v1.ApplyOptions) (result *apiv1alpha2.InferencePool, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apixv1alpha2.InferencePool, err error) + Apply(ctx context.Context, inferencePool *applyconfigurationapixv1alpha2.InferencePoolApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha2.InferencePool, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, inferencePool *applyconfigurationapiv1alpha2.InferencePoolApplyConfiguration, opts v1.ApplyOptions) (result *apiv1alpha2.InferencePool, err error) + ApplyStatus(ctx context.Context, inferencePool *applyconfigurationapixv1alpha2.InferencePoolApplyConfiguration, opts v1.ApplyOptions) (result *apixv1alpha2.InferencePool, err error) InferencePoolExpansion } // inferencePools implements InferencePoolInterface type inferencePools struct { - *gentype.ClientWithListAndApply[*apiv1alpha2.InferencePool, *apiv1alpha2.InferencePoolList, *applyconfigurationapiv1alpha2.InferencePoolApplyConfiguration] + *gentype.ClientWithListAndApply[*apixv1alpha2.InferencePool, *apixv1alpha2.InferencePoolList, *applyconfigurationapixv1alpha2.InferencePoolApplyConfiguration] } // newInferencePools returns a InferencePools -func newInferencePools(c *InferenceV1alpha2Client, namespace string) *inferencePools { +func newInferencePools(c *XInferenceV1alpha2Client, namespace string) *inferencePools { return &inferencePools{ - gentype.NewClientWithListAndApply[*apiv1alpha2.InferencePool, *apiv1alpha2.InferencePoolList, *applyconfigurationapiv1alpha2.InferencePoolApplyConfiguration]( + gentype.NewClientWithListAndApply[*apixv1alpha2.InferencePool, *apixv1alpha2.InferencePoolList, *applyconfigurationapixv1alpha2.InferencePoolApplyConfiguration]( "inferencepools", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *apiv1alpha2.InferencePool { return &apiv1alpha2.InferencePool{} }, - func() *apiv1alpha2.InferencePoolList { return &apiv1alpha2.InferencePoolList{} }, + func() *apixv1alpha2.InferencePool { return &apixv1alpha2.InferencePool{} }, + func() *apixv1alpha2.InferencePoolList { return &apixv1alpha2.InferencePoolList{} }, ), } } diff --git a/client-go/informers/externalversions/api/interface.go b/client-go/informers/externalversions/api/interface.go index d7890db51..220becd42 100644 --- a/client-go/informers/externalversions/api/interface.go +++ b/client-go/informers/externalversions/api/interface.go @@ -19,14 +19,14 @@ limitations under the License. package api import ( - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/api/v1alpha2" + v1 "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/api/v1" 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 { - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/client-go/informers/externalversions/api/v1/inferencepool.go b/client-go/informers/externalversions/api/v1/inferencepool.go new file mode 100644 index 000000000..d4144fe6b --- /dev/null +++ b/client-go/informers/externalversions/api/v1/inferencepool.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 v1 + +import ( + context "context" + time "time" + + metav1 "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" + gatewayapiinferenceextensionapiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + 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" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/api/v1" +) + +// InferencePoolInformer provides access to a shared informer and lister for +// InferencePools. +type InferencePoolInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1.InferencePoolLister +} + +type inferencePoolInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewInferencePoolInformer constructs a new informer for InferencePool 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 NewInferencePoolInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInferencePoolInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredInferencePoolInformer constructs a new informer for InferencePool 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 NewFilteredInferencePoolInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1().InferencePools(namespace).List(context.Background(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1().InferencePools(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1().InferencePools(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InferenceV1().InferencePools(namespace).Watch(ctx, options) + }, + }, + &gatewayapiinferenceextensionapiv1.InferencePool{}, + resyncPeriod, + indexers, + ) +} + +func (f *inferencePoolInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInferencePoolInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inferencePoolInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiinferenceextensionapiv1.InferencePool{}, f.defaultInformer) +} + +func (f *inferencePoolInformer) Lister() apiv1.InferencePoolLister { + return apiv1.NewInferencePoolLister(f.Informer().GetIndexer()) +} diff --git a/client-go/informers/externalversions/api/v1/interface.go b/client-go/informers/externalversions/api/v1/interface.go new file mode 100644 index 000000000..b83492b42 --- /dev/null +++ b/client-go/informers/externalversions/api/v1/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 v1 + +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 { + // InferencePools returns a InferencePoolInformer. + InferencePools() InferencePoolInformer +} + +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} +} + +// InferencePools returns a InferencePoolInformer. +func (v *version) InferencePools() InferencePoolInformer { + return &inferencePoolInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/client-go/informers/externalversions/apix/interface.go b/client-go/informers/externalversions/apix/interface.go new file mode 100644 index 000000000..26e18173f --- /dev/null +++ b/client-go/informers/externalversions/apix/interface.go @@ -0,0 +1,46 @@ +/* +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 apix + +import ( + 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 { + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface +} + +type group 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 &group{factory: f, namespace: namespace, tweakListOptions: 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/api/v1alpha2/inferencemodel.go b/client-go/informers/externalversions/apix/v1alpha2/inferencemodel.go similarity index 79% rename from client-go/informers/externalversions/api/v1alpha2/inferencemodel.go rename to client-go/informers/externalversions/apix/v1alpha2/inferencemodel.go index 0bf9ca43e..7b6ce90eb 100644 --- a/client-go/informers/externalversions/api/v1alpha2/inferencemodel.go +++ b/client-go/informers/externalversions/apix/v1alpha2/inferencemodel.go @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - gatewayapiinferenceextensionapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + gatewayapiinferenceextensionapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" 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" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/apix/v1alpha2" ) // InferenceModelInformer provides access to a shared informer and lister for // InferenceModels. type InferenceModelInformer interface { Informer() cache.SharedIndexInformer - Lister() apiv1alpha2.InferenceModelLister + Lister() apixv1alpha2.InferenceModelLister } type inferenceModelInformer struct { @@ -62,28 +62,28 @@ func NewFilteredInferenceModelInformer(client versioned.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferenceModels(namespace).List(context.Background(), options) + return client.XInferenceV1alpha2().InferenceModels(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferenceModels(namespace).Watch(context.Background(), options) + return client.XInferenceV1alpha2().InferenceModels(namespace).Watch(context.Background(), options) }, ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferenceModels(namespace).List(ctx, options) + return client.XInferenceV1alpha2().InferenceModels(namespace).List(ctx, options) }, WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferenceModels(namespace).Watch(ctx, options) + return client.XInferenceV1alpha2().InferenceModels(namespace).Watch(ctx, options) }, }, - &gatewayapiinferenceextensionapiv1alpha2.InferenceModel{}, + &gatewayapiinferenceextensionapixv1alpha2.InferenceModel{}, resyncPeriod, indexers, ) @@ -94,9 +94,9 @@ func (f *inferenceModelInformer) defaultInformer(client versioned.Interface, res } func (f *inferenceModelInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gatewayapiinferenceextensionapiv1alpha2.InferenceModel{}, f.defaultInformer) + return f.factory.InformerFor(&gatewayapiinferenceextensionapixv1alpha2.InferenceModel{}, f.defaultInformer) } -func (f *inferenceModelInformer) Lister() apiv1alpha2.InferenceModelLister { - return apiv1alpha2.NewInferenceModelLister(f.Informer().GetIndexer()) +func (f *inferenceModelInformer) Lister() apixv1alpha2.InferenceModelLister { + return apixv1alpha2.NewInferenceModelLister(f.Informer().GetIndexer()) } diff --git a/client-go/informers/externalversions/api/v1alpha2/inferencepool.go b/client-go/informers/externalversions/apix/v1alpha2/inferencepool.go similarity index 79% rename from client-go/informers/externalversions/api/v1alpha2/inferencepool.go rename to client-go/informers/externalversions/apix/v1alpha2/inferencepool.go index c52a0f349..2587972cb 100644 --- a/client-go/informers/externalversions/api/v1alpha2/inferencepool.go +++ b/client-go/informers/externalversions/apix/v1alpha2/inferencepool.go @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - gatewayapiinferenceextensionapiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + gatewayapiinferenceextensionapixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" 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" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/client-go/listers/apix/v1alpha2" ) // InferencePoolInformer provides access to a shared informer and lister for // InferencePools. type InferencePoolInformer interface { Informer() cache.SharedIndexInformer - Lister() apiv1alpha2.InferencePoolLister + Lister() apixv1alpha2.InferencePoolLister } type inferencePoolInformer struct { @@ -62,28 +62,28 @@ func NewFilteredInferencePoolInformer(client versioned.Interface, namespace stri if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferencePools(namespace).List(context.Background(), options) + return client.XInferenceV1alpha2().InferencePools(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferencePools(namespace).Watch(context.Background(), options) + return client.XInferenceV1alpha2().InferencePools(namespace).Watch(context.Background(), options) }, ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferencePools(namespace).List(ctx, options) + return client.XInferenceV1alpha2().InferencePools(namespace).List(ctx, options) }, WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InferenceV1alpha2().InferencePools(namespace).Watch(ctx, options) + return client.XInferenceV1alpha2().InferencePools(namespace).Watch(ctx, options) }, }, - &gatewayapiinferenceextensionapiv1alpha2.InferencePool{}, + &gatewayapiinferenceextensionapixv1alpha2.InferencePool{}, resyncPeriod, indexers, ) @@ -94,9 +94,9 @@ func (f *inferencePoolInformer) defaultInformer(client versioned.Interface, resy } func (f *inferencePoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&gatewayapiinferenceextensionapiv1alpha2.InferencePool{}, f.defaultInformer) + return f.factory.InformerFor(&gatewayapiinferenceextensionapixv1alpha2.InferencePool{}, f.defaultInformer) } -func (f *inferencePoolInformer) Lister() apiv1alpha2.InferencePoolLister { - return apiv1alpha2.NewInferencePoolLister(f.Informer().GetIndexer()) +func (f *inferencePoolInformer) Lister() apixv1alpha2.InferencePoolLister { + return apixv1alpha2.NewInferencePoolLister(f.Informer().GetIndexer()) } diff --git a/client-go/informers/externalversions/api/v1alpha2/interface.go b/client-go/informers/externalversions/apix/v1alpha2/interface.go similarity index 100% rename from client-go/informers/externalversions/api/v1alpha2/interface.go rename to client-go/informers/externalversions/apix/v1alpha2/interface.go diff --git a/client-go/informers/externalversions/factory.go b/client-go/informers/externalversions/factory.go index 7593e5174..e6b97ca95 100644 --- a/client-go/informers/externalversions/factory.go +++ b/client-go/informers/externalversions/factory.go @@ -29,6 +29,7 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "sigs.k8s.io/gateway-api-inference-extension/client-go/clientset/versioned" api "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/api" + apix "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/apix" internalinterfaces "sigs.k8s.io/gateway-api-inference-extension/client-go/informers/externalversions/internalinterfaces" ) @@ -255,8 +256,13 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer Inference() api.Interface + XInference() apix.Interface } func (f *sharedInformerFactory) Inference() api.Interface { return api.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) XInference() apix.Interface { + return apix.New(f, f.namespace, f.tweakListOptions) +} diff --git a/client-go/informers/externalversions/generic.go b/client-go/informers/externalversions/generic.go index b044039b2..d3f3ad5a9 100644 --- a/client-go/informers/externalversions/generic.go +++ b/client-go/informers/externalversions/generic.go @@ -23,7 +23,8 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + v1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -52,11 +53,15 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=inference.networking.x-k8s.io, Version=v1alpha2 + // Group=inference.networking.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("inferencepools"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Inference().V1().InferencePools().Informer()}, nil + + // Group=inference.networking.x-k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithResource("inferencemodels"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Inference().V1alpha2().InferenceModels().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.XInference().V1alpha2().InferenceModels().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("inferencepools"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Inference().V1alpha2().InferencePools().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.XInference().V1alpha2().InferencePools().Informer()}, nil } diff --git a/client-go/listers/api/v1/expansion_generated.go b/client-go/listers/api/v1/expansion_generated.go new file mode 100644 index 000000000..b30a01d47 --- /dev/null +++ b/client-go/listers/api/v1/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 v1 + +// InferencePoolListerExpansion allows custom methods to be added to +// InferencePoolLister. +type InferencePoolListerExpansion interface{} + +// InferencePoolNamespaceListerExpansion allows custom methods to be added to +// InferencePoolNamespaceLister. +type InferencePoolNamespaceListerExpansion interface{} diff --git a/client-go/listers/api/v1alpha2/inferencepool.go b/client-go/listers/api/v1/inferencepool.go similarity index 79% rename from client-go/listers/api/v1alpha2/inferencepool.go rename to client-go/listers/api/v1/inferencepool.go index 0ddea52a1..5e5f5decd 100644 --- a/client-go/listers/api/v1alpha2/inferencepool.go +++ b/client-go/listers/api/v1/inferencepool.go @@ -16,13 +16,13 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1 import ( labels "k8s.io/apimachinery/pkg/labels" listers "k8s.io/client-go/listers" cache "k8s.io/client-go/tools/cache" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apiv1 "sigs.k8s.io/gateway-api-inference-extension/api/v1" ) // InferencePoolLister helps list InferencePools. @@ -30,7 +30,7 @@ import ( type InferencePoolLister interface { // List lists all InferencePools in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*apiv1alpha2.InferencePool, err error) + List(selector labels.Selector) (ret []*apiv1.InferencePool, err error) // InferencePools returns an object that can list and get InferencePools. InferencePools(namespace string) InferencePoolNamespaceLister InferencePoolListerExpansion @@ -38,17 +38,17 @@ type InferencePoolLister interface { // inferencePoolLister implements the InferencePoolLister interface. type inferencePoolLister struct { - listers.ResourceIndexer[*apiv1alpha2.InferencePool] + listers.ResourceIndexer[*apiv1.InferencePool] } // NewInferencePoolLister returns a new InferencePoolLister. func NewInferencePoolLister(indexer cache.Indexer) InferencePoolLister { - return &inferencePoolLister{listers.New[*apiv1alpha2.InferencePool](indexer, apiv1alpha2.Resource("inferencepool"))} + return &inferencePoolLister{listers.New[*apiv1.InferencePool](indexer, apiv1.Resource("inferencepool"))} } // InferencePools returns an object that can list and get InferencePools. func (s *inferencePoolLister) InferencePools(namespace string) InferencePoolNamespaceLister { - return inferencePoolNamespaceLister{listers.NewNamespaced[*apiv1alpha2.InferencePool](s.ResourceIndexer, namespace)} + return inferencePoolNamespaceLister{listers.NewNamespaced[*apiv1.InferencePool](s.ResourceIndexer, namespace)} } // InferencePoolNamespaceLister helps list and get InferencePools. @@ -56,15 +56,15 @@ func (s *inferencePoolLister) InferencePools(namespace string) InferencePoolName type InferencePoolNamespaceLister interface { // List lists all InferencePools in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*apiv1alpha2.InferencePool, err error) + List(selector labels.Selector) (ret []*apiv1.InferencePool, err error) // Get retrieves the InferencePool from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*apiv1alpha2.InferencePool, error) + Get(name string) (*apiv1.InferencePool, error) InferencePoolNamespaceListerExpansion } // inferencePoolNamespaceLister implements the InferencePoolNamespaceLister // interface. type inferencePoolNamespaceLister struct { - listers.ResourceIndexer[*apiv1alpha2.InferencePool] + listers.ResourceIndexer[*apiv1.InferencePool] } diff --git a/client-go/listers/api/v1alpha2/expansion_generated.go b/client-go/listers/apix/v1alpha2/expansion_generated.go similarity index 100% rename from client-go/listers/api/v1alpha2/expansion_generated.go rename to client-go/listers/apix/v1alpha2/expansion_generated.go diff --git a/client-go/listers/api/v1alpha2/inferencemodel.go b/client-go/listers/apix/v1alpha2/inferencemodel.go similarity index 79% rename from client-go/listers/api/v1alpha2/inferencemodel.go rename to client-go/listers/apix/v1alpha2/inferencemodel.go index 075ba77ce..a6e2c3c05 100644 --- a/client-go/listers/api/v1alpha2/inferencemodel.go +++ b/client-go/listers/apix/v1alpha2/inferencemodel.go @@ -22,7 +22,7 @@ import ( labels "k8s.io/apimachinery/pkg/labels" listers "k8s.io/client-go/listers" cache "k8s.io/client-go/tools/cache" - apiv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // InferenceModelLister helps list InferenceModels. @@ -30,7 +30,7 @@ import ( type InferenceModelLister interface { // List lists all InferenceModels in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*apiv1alpha2.InferenceModel, err error) + List(selector labels.Selector) (ret []*apixv1alpha2.InferenceModel, err error) // InferenceModels returns an object that can list and get InferenceModels. InferenceModels(namespace string) InferenceModelNamespaceLister InferenceModelListerExpansion @@ -38,17 +38,17 @@ type InferenceModelLister interface { // inferenceModelLister implements the InferenceModelLister interface. type inferenceModelLister struct { - listers.ResourceIndexer[*apiv1alpha2.InferenceModel] + listers.ResourceIndexer[*apixv1alpha2.InferenceModel] } // NewInferenceModelLister returns a new InferenceModelLister. func NewInferenceModelLister(indexer cache.Indexer) InferenceModelLister { - return &inferenceModelLister{listers.New[*apiv1alpha2.InferenceModel](indexer, apiv1alpha2.Resource("inferencemodel"))} + return &inferenceModelLister{listers.New[*apixv1alpha2.InferenceModel](indexer, apixv1alpha2.Resource("inferencemodel"))} } // InferenceModels returns an object that can list and get InferenceModels. func (s *inferenceModelLister) InferenceModels(namespace string) InferenceModelNamespaceLister { - return inferenceModelNamespaceLister{listers.NewNamespaced[*apiv1alpha2.InferenceModel](s.ResourceIndexer, namespace)} + return inferenceModelNamespaceLister{listers.NewNamespaced[*apixv1alpha2.InferenceModel](s.ResourceIndexer, namespace)} } // InferenceModelNamespaceLister helps list and get InferenceModels. @@ -56,15 +56,15 @@ func (s *inferenceModelLister) InferenceModels(namespace string) InferenceModelN type InferenceModelNamespaceLister interface { // List lists all InferenceModels in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*apiv1alpha2.InferenceModel, err error) + List(selector labels.Selector) (ret []*apixv1alpha2.InferenceModel, err error) // Get retrieves the InferenceModel from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*apiv1alpha2.InferenceModel, error) + Get(name string) (*apixv1alpha2.InferenceModel, error) InferenceModelNamespaceListerExpansion } // inferenceModelNamespaceLister implements the InferenceModelNamespaceLister // interface. type inferenceModelNamespaceLister struct { - listers.ResourceIndexer[*apiv1alpha2.InferenceModel] + listers.ResourceIndexer[*apixv1alpha2.InferenceModel] } diff --git a/client-go/listers/apix/v1alpha2/inferencepool.go b/client-go/listers/apix/v1alpha2/inferencepool.go new file mode 100644 index 000000000..50c9c74c7 --- /dev/null +++ b/client-go/listers/apix/v1alpha2/inferencepool.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 v1alpha2 + +import ( + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + apixv1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" +) + +// InferencePoolLister helps list InferencePools. +// All objects returned here must be treated as read-only. +type InferencePoolLister interface { + // List lists all InferencePools in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apixv1alpha2.InferencePool, err error) + // InferencePools returns an object that can list and get InferencePools. + InferencePools(namespace string) InferencePoolNamespaceLister + InferencePoolListerExpansion +} + +// inferencePoolLister implements the InferencePoolLister interface. +type inferencePoolLister struct { + listers.ResourceIndexer[*apixv1alpha2.InferencePool] +} + +// NewInferencePoolLister returns a new InferencePoolLister. +func NewInferencePoolLister(indexer cache.Indexer) InferencePoolLister { + return &inferencePoolLister{listers.New[*apixv1alpha2.InferencePool](indexer, apixv1alpha2.Resource("inferencepool"))} +} + +// InferencePools returns an object that can list and get InferencePools. +func (s *inferencePoolLister) InferencePools(namespace string) InferencePoolNamespaceLister { + return inferencePoolNamespaceLister{listers.NewNamespaced[*apixv1alpha2.InferencePool](s.ResourceIndexer, namespace)} +} + +// InferencePoolNamespaceLister helps list and get InferencePools. +// All objects returned here must be treated as read-only. +type InferencePoolNamespaceLister interface { + // List lists all InferencePools in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apixv1alpha2.InferencePool, err error) + // Get retrieves the InferencePool from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apixv1alpha2.InferencePool, error) + InferencePoolNamespaceListerExpansion +} + +// inferencePoolNamespaceLister implements the InferencePoolNamespaceLister +// interface. +type inferencePoolNamespaceLister struct { + listers.ResourceIndexer[*apixv1alpha2.InferencePool] +} diff --git a/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml b/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml new file mode 100644 index 000000000..a67ca57a4 --- /dev/null +++ b/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml @@ -0,0 +1,292 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.kubernetes.io: unapproved, experimental-only + inference.networking.k8s.io/bundle-version: v1.0.0-dev + creationTimestamp: null + name: inferencepools.inference.networking.k8s.io +spec: + group: inference.networking.k8s.io + names: + kind: InferencePool + listKind: InferencePoolList + plural: inferencepools + singular: inferencepool + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: | + InferencePool is the Schema for the InferencePools 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: InferencePoolSpec defines the desired state of InferencePool + properties: + extensionRef: + description: Extension configures an endpoint picker as an extension + service. + properties: + failureMode: + default: FailClose + description: |- + Configures how the gateway handles the case when the extension is not responsive. + Defaults to failClose. + enum: + - FailOpen + - FailClose + type: string + group: + default: "" + description: |- + Group is the group of the referent. + The default value is "", representing the Core API group. + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + default: Service + description: |- + Kind is the Kubernetes resource kind of the referent. + + Defaults to "Service" when not specified. + + ExternalName services can refer to CNAME DNS records that may live + outside of the cluster and as such are difficult to reason about in + terms of conformance. They also may not be safe to forward to (see + CVE-2021-25740 for more information). Implementations MUST NOT + support ExternalName Services. + 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. + maxLength: 253 + minLength: 1 + type: string + portNumber: + description: |- + The port number on the service running the extension. When unspecified, + implementations SHOULD infer a default value of 9002 when the Kind is + Service. + format: int32 + maximum: 65535 + minimum: 1 + type: integer + required: + - name + type: object + selector: + additionalProperties: + description: |- + LabelValue is the value of a label. This is used for validation + of maps. This matches the Kubernetes label validation rules: + * must be 63 characters or less (can be empty), + * unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), + * could contain dashes (-), underscores (_), dots (.), and alphanumerics between. + + Valid values include: + + * MyValue + * my.name + * 123-my-value + maxLength: 63 + minLength: 0 + pattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$ + type: string + description: |- + Selector defines a map of labels to watch model server Pods + that should be included in the InferencePool. + In some cases, implementations may translate this field to a Service selector, so this matches the simple + map used for Service selectors instead of the full Kubernetes LabelSelector type. + If specified, it will be applied to match the model server pods in the same namespace as the InferencePool. + Cross namesoace selector is not supported. + type: object + targetPortNumber: + description: |- + TargetPortNumber defines the port number to access the selected model server Pods. + The number must be in the range 1 to 65535. + format: int32 + maximum: 65535 + minimum: 1 + type: integer + required: + - extensionRef + - selector + - targetPortNumber + type: object + status: + default: + parent: + - conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Accepted + parentRef: + kind: Status + name: default + description: Status defines the observed state of InferencePool. + properties: + parent: + description: |- + Parents is a list of parent resources (usually Gateways) that are + associated with the InferencePool, and the status of the InferencePool with respect to + each parent. + + A maximum of 32 Gateways will be represented in this list. When the list contains + `kind: Status, name: default`, it indicates that the InferencePool is not + associated with any Gateway and a controller must perform the following: + + - Remove the parent when setting the "Accepted" condition. + - Add the parent when the controller will no longer manage the InferencePool + and no other parents exist. + items: + description: PoolStatus defines the observed state of InferencePool + from a Gateway. + properties: + conditions: + default: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Accepted + description: |- + Conditions track the state of the InferencePool. + + Known 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 + parentRef: + description: GatewayRef indicates the gateway that observed + state of InferencePool. + properties: + group: + default: gateway.networking.k8s.io + description: Group is the group of the referent. + maxLength: 253 + 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 kind of the referent. For example "Gateway". + 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. + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + Namespace is the namespace of the referent. If not present, + the namespace of the referent is assumed to be the same as + the namespace of the referring object. + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - name + type: object + required: + - parentRef + type: object + maxItems: 32 + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml b/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml index d603fda76..68144f906 100644 --- a/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml +++ b/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml @@ -2,6 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + api-approved.kubernetes.io: unapproved, experimental-only inference.networking.k8s.io/bundle-version: v1.0.0-dev creationTimestamp: null name: inferencepools.inference.networking.x-k8s.io @@ -17,7 +18,8 @@ spec: - name: v1alpha2 schema: openAPIV3Schema: - description: InferencePool is the Schema for the InferencePools API. + description: | + InferencePool is the Schema for the InferencePools API. properties: apiVersion: description: |- @@ -63,8 +65,7 @@ spec: kind: default: Service description: |- - Kind is the Kubernetes resource kind of the referent. For example - "Service". + Kind is the Kubernetes resource kind of the referent. Defaults to "Service" when not specified. @@ -113,16 +114,16 @@ spec: pattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$ type: string description: |- - Selector defines a map of labels to watch model server pods + Selector defines a map of labels to watch model server Pods that should be included in the InferencePool. In some cases, implementations may translate this field to a Service selector, so this matches the simple map used for Service selectors instead of the full Kubernetes LabelSelector type. - If sepecified, it will be applied to match the model server pods in the same namespace as the InferencePool. + If specified, it will be applied to match the model server pods in the same namespace as the InferencePool. Cross namesoace selector is not supported. type: object targetPortNumber: description: |- - TargetPortNumber defines the port number to access the selected model servers. + TargetPortNumber defines the port number to access the selected model server Pods. The number must be in the range 1 to 65535. format: int32 maximum: 65535 diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 60bac40b8..d8d64ae34 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -4,6 +4,7 @@ resources: - bases/inference.networking.x-k8s.io_inferencepools.yaml - bases/inference.networking.x-k8s.io_inferencemodels.yaml +- bases/inference.networking.k8s.io_inferencepools.yaml # +kubebuilder:scaffold:crdkustomizeresource patches: diff --git a/conformance/conformance.go b/conformance/conformance.go index 5c1a317a3..656af7c53 100644 --- a/conformance/conformance.go +++ b/conformance/conformance.go @@ -62,7 +62,7 @@ import ( // _ "sigs.k8s.io/gateway-api-inference-extension/conformance/tests/model_routing" // Import the Inference Extension API types - inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + inferencev1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" inferenceconfig "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/config" ) diff --git a/conformance/tests/basic/inferencepool_invalid_epp_service.go b/conformance/tests/basic/inferencepool_invalid_epp_service.go index a9c3059f1..602443f34 100644 --- a/conformance/tests/basic/inferencepool_invalid_epp_service.go +++ b/conformance/tests/basic/inferencepool_invalid_epp_service.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - inferenceapi "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + inferenceapi "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" diff --git a/conformance/utils/kubernetes/helpers.go b/conformance/utils/kubernetes/helpers.go index 6f40999f0..0c7d5ecc0 100644 --- a/conformance/utils/kubernetes/helpers.go +++ b/conformance/utils/kubernetes/helpers.go @@ -34,7 +34,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - inferenceapi "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + inferenceapi "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/config" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayapiconfig "sigs.k8s.io/gateway-api/conformance/utils/config" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index da26b841d..9b3866dd1 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. +# 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. diff --git a/pkg/epp/backend/metrics/logger.go b/pkg/epp/backend/metrics/logger.go index 9494f14e7..d6e95059f 100644 --- a/pkg/epp/backend/metrics/logger.go +++ b/pkg/epp/backend/metrics/logger.go @@ -23,7 +23,7 @@ import ( "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics" logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging" ) diff --git a/pkg/epp/backend/metrics/pod_metrics_test.go b/pkg/epp/backend/metrics/pod_metrics_test.go index 796b636b4..4a4bafc6c 100644 --- a/pkg/epp/backend/metrics/pod_metrics_test.go +++ b/pkg/epp/backend/metrics/pod_metrics_test.go @@ -26,7 +26,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) var ( diff --git a/pkg/epp/common/config/loader/configloader.go b/pkg/epp/common/config/loader/configloader.go index fab130e12..5ca141a90 100644 --- a/pkg/epp/common/config/loader/configloader.go +++ b/pkg/epp/common/config/loader/configloader.go @@ -25,7 +25,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" - configapi "sigs.k8s.io/gateway-api-inference-extension/api/config/v1alpha1" + configapi "sigs.k8s.io/gateway-api-inference-extension/apix/config/v1alpha1" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/plugins" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework" diff --git a/pkg/epp/common/config/loader/configloader_test.go b/pkg/epp/common/config/loader/configloader_test.go index 233f76aa7..e4610e86d 100644 --- a/pkg/epp/common/config/loader/configloader_test.go +++ b/pkg/epp/common/config/loader/configloader_test.go @@ -26,7 +26,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - configapi "sigs.k8s.io/gateway-api-inference-extension/api/config/v1alpha1" + configapi "sigs.k8s.io/gateway-api-inference-extension/apix/config/v1alpha1" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/plugins" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework/plugins/filter" diff --git a/pkg/epp/controller/inferencemodel_reconciler.go b/pkg/epp/controller/inferencemodel_reconciler.go index f1774ffbb..9ef87fd0e 100644 --- a/pkg/epp/controller/inferencemodel_reconciler.go +++ b/pkg/epp/controller/inferencemodel_reconciler.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging" ) diff --git a/pkg/epp/controller/inferencemodel_reconciler_test.go b/pkg/epp/controller/inferencemodel_reconciler_test.go index 838737a72..bbea0ef17 100644 --- a/pkg/epp/controller/inferencemodel_reconciler_test.go +++ b/pkg/epp/controller/inferencemodel_reconciler_test.go @@ -30,7 +30,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" utiltest "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" diff --git a/pkg/epp/controller/inferencepool_reconciler.go b/pkg/epp/controller/inferencepool_reconciler.go index 54781703b..9bf5d8aea 100644 --- a/pkg/epp/controller/inferencepool_reconciler.go +++ b/pkg/epp/controller/inferencepool_reconciler.go @@ -24,7 +24,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging" ) diff --git a/pkg/epp/controller/inferencepool_reconciler_test.go b/pkg/epp/controller/inferencepool_reconciler_test.go index c61abb327..4e0c0f1bf 100644 --- a/pkg/epp/controller/inferencepool_reconciler_test.go +++ b/pkg/epp/controller/inferencepool_reconciler_test.go @@ -30,7 +30,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" utiltest "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" diff --git a/pkg/epp/controller/pod_reconciler_test.go b/pkg/epp/controller/pod_reconciler_test.go index bbb2a8318..898731a8d 100644 --- a/pkg/epp/controller/pod_reconciler_test.go +++ b/pkg/epp/controller/pod_reconciler_test.go @@ -31,7 +31,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" utiltest "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" diff --git a/pkg/epp/datastore/datastore.go b/pkg/epp/datastore/datastore.go index 524355413..f19f26ca6 100644 --- a/pkg/epp/datastore/datastore.go +++ b/pkg/epp/datastore/datastore.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging" podutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/pod" diff --git a/pkg/epp/datastore/datastore_test.go b/pkg/epp/datastore/datastore_test.go index cf1f610cb..1780ff2c9 100644 --- a/pkg/epp/datastore/datastore_test.go +++ b/pkg/epp/datastore/datastore_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" testutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" ) diff --git a/pkg/epp/handlers/server.go b/pkg/epp/handlers/server.go index 3ac13c892..077dd55df 100644 --- a/pkg/epp/handlers/server.go +++ b/pkg/epp/handlers/server.go @@ -29,7 +29,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics" schedulingtypes "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types" diff --git a/pkg/epp/metrics/collectors/inference_pool_test.go b/pkg/epp/metrics/collectors/inference_pool_test.go index d97377ee7..9b584a883 100644 --- a/pkg/epp/metrics/collectors/inference_pool_test.go +++ b/pkg/epp/metrics/collectors/inference_pool_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/component-base/metrics/testutil" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" ) diff --git a/pkg/epp/requestcontrol/director.go b/pkg/epp/requestcontrol/director.go index 670d9222a..2ad28b860 100644 --- a/pkg/epp/requestcontrol/director.go +++ b/pkg/epp/requestcontrol/director.go @@ -29,7 +29,7 @@ import ( "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" diff --git a/pkg/epp/requestcontrol/director_test.go b/pkg/epp/requestcontrol/director_test.go index d0571bf6e..b384069e9 100644 --- a/pkg/epp/requestcontrol/director_test.go +++ b/pkg/epp/requestcontrol/director_test.go @@ -32,7 +32,7 @@ import ( k8stypes "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" diff --git a/pkg/epp/server/controller_manager.go b/pkg/epp/server/controller_manager.go index 89e509696..4a56adccc 100644 --- a/pkg/epp/server/controller_manager.go +++ b/pkg/epp/server/controller_manager.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) var scheme = runtime.NewScheme() diff --git a/pkg/epp/server/server_test.go b/pkg/epp/server/server_test.go index 3696f5a71..c59152365 100644 --- a/pkg/epp/server/server_test.go +++ b/pkg/epp/server/server_test.go @@ -24,7 +24,7 @@ import ( pb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/handlers" testutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" diff --git a/pkg/epp/util/testing/diff.go b/pkg/epp/util/testing/diff.go index 34b0b8caf..def3b148e 100644 --- a/pkg/epp/util/testing/diff.go +++ b/pkg/epp/util/testing/diff.go @@ -19,7 +19,7 @@ package testing import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) func DiffModelLists(want, got []*v1alpha2.InferenceModel) string { diff --git a/pkg/epp/util/testing/wrappers.go b/pkg/epp/util/testing/wrappers.go index 130f017e9..4dfe36a55 100644 --- a/pkg/epp/util/testing/wrappers.go +++ b/pkg/epp/util/testing/wrappers.go @@ -19,7 +19,7 @@ package testing import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // PodWrapper wraps a Pod. diff --git a/pkg/generator/main.go b/pkg/generator/main.go index 3f720becf..6ca70ed11 100644 --- a/pkg/generator/main.go +++ b/pkg/generator/main.go @@ -34,7 +34,8 @@ 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/api/v1alpha2", + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2", + "sigs.k8s.io/gateway-api-inference-extension/api/v1", ) if err != nil { log.Fatalf("failed to load package roots: %s", err) diff --git a/test/e2e/epp/e2e_suite_test.go b/test/e2e/epp/e2e_suite_test.go index 0ccde422a..4cac4f4dc 100644 --- a/test/e2e/epp/e2e_suite_test.go +++ b/test/e2e/epp/e2e_suite_test.go @@ -40,7 +40,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" - infextv1a2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + infextv1a2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" testutils "sigs.k8s.io/gateway-api-inference-extension/test/utils" ) diff --git a/test/e2e/epp/e2e_test.go b/test/e2e/epp/e2e_test.go index 7bf31ac92..f3d7a3254 100644 --- a/test/e2e/epp/e2e_test.go +++ b/test/e2e/epp/e2e_test.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/utils/ptr" client "sigs.k8s.io/controller-runtime/pkg/client" - v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" testutils "sigs.k8s.io/gateway-api-inference-extension/test/utils" ) diff --git a/test/integration/epp/hermetic_test.go b/test/integration/epp/hermetic_test.go index 3a3bd9eff..7cffab35e 100644 --- a/test/integration/epp/hermetic_test.go +++ b/test/integration/epp/hermetic_test.go @@ -57,7 +57,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" "sigs.k8s.io/yaml" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend" backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" diff --git a/test/utils/server.go b/test/utils/server.go index f3d0a5a94..22b28f831 100644 --- a/test/utils/server.go +++ b/test/utils/server.go @@ -32,7 +32,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore" testutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/testing" diff --git a/test/utils/utils.go b/test/utils/utils.go index ba74069ff..a3d12e198 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -36,7 +36,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // DeleteClusterResources deletes all cluster-scoped objects the tests typically create. diff --git a/test/utils/wrappers.go b/test/utils/wrappers.go index 4f12591a4..0039e0a6c 100644 --- a/test/utils/wrappers.go +++ b/test/utils/wrappers.go @@ -19,7 +19,7 @@ package utils import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2" + "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha2" ) // InferenceModelWrapper wraps an InferenceModel.