diff --git a/hack/tools.go b/hack/tools.go index 68776828..418d991e 100644 --- a/hack/tools.go +++ b/hack/tools.go @@ -1,4 +1,6 @@ +//go:build tools // +build tools + package tools import _ "k8s.io/code-generator" diff --git a/pkg/apis/batch/v1alpha1/job.go b/pkg/apis/batch/v1alpha1/job.go index 9da2f88b..4e6ba946 100644 --- a/pkg/apis/batch/v1alpha1/job.go +++ b/pkg/apis/batch/v1alpha1/job.go @@ -175,6 +175,7 @@ const ( ) // LifecyclePolicy specifies the lifecycle and error handling of task and job. +// +kubebuilder:validation:XValidation:rule="self.action != 'WebHook' || has(self.webhookConfig)",message="webhookConfig is required when action is WebHook" type LifecyclePolicy struct { // The action that will be taken to the PodGroup according to Event. // One of "Restart", "None". @@ -202,6 +203,46 @@ type LifecyclePolicy struct { // Default to nil (take action immediately). // +optional Timeout *metav1.Duration `json:"timeout,omitempty" protobuf:"bytes,5,opt,name=timeout"` + + // WebHookConfig specifies webhook configuration when Action is WebHook + // +optional + WebHookConfig *WebHookConfig `json:"webhookConfig,omitempty" protobuf:"bytes,6,opt,name=webhookConfig"` +} + +// WebHookConfig defines webhook configuration +type WebHookConfig struct { + // URL is the webhook endpoint URL + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=`^https?://.*` + URL string `json:"url" protobuf:"bytes,1,opt,name=url"` + + // Method is the HTTP method, defaults to POST + // +kubebuilder:validation:Enum=GET;POST;PUT;PATCH + // +kubebuilder:default="POST" + // +optional + Method string `json:"method,omitempty" protobuf:"bytes,2,opt,name=method"` + + // Headers are custom HTTP headers to send + // +optional + Headers map[string]string `json:"headers,omitempty" protobuf:"bytes,3,opt,name=headers"` + + // Body is the JSON request body template, supports variable substitution + // +optional + Body string `json:"body,omitempty" protobuf:"bytes,4,opt,name=body"` + + // TimeoutSeconds is request timeout in seconds, defaults to 30 + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=300 + // +kubebuilder:default=30 + // +optional + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"bytes,5,opt,name=timeoutSeconds"` + + // Retries is the number of retry attempts for failed webhook requests, defaults to 3 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=10 + // +kubebuilder:default=3 + // +optional + Retries *int32 `json:"retries,omitempty" protobuf:"bytes,6,opt,name=retries"` } // +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node diff --git a/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go index cdaa99e2..1871a343 100644 --- a/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go @@ -279,6 +279,11 @@ func (in *LifecyclePolicy) DeepCopyInto(out *LifecyclePolicy) { *out = new(v1.Duration) **out = **in } + if in.WebHookConfig != nil { + in, out := &in.WebHookConfig, &out.WebHookConfig + *out = new(WebHookConfig) + (*in).DeepCopyInto(*out) + } return } @@ -390,3 +395,36 @@ func (in *VolumeSpec) DeepCopy() *VolumeSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebHookConfig) DeepCopyInto(out *WebHookConfig) { + *out = *in + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int32) + **out = **in + } + if in.Retries != nil { + in, out := &in.Retries, &out.Retries + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebHookConfig. +func (in *WebHookConfig) DeepCopy() *WebHookConfig { + if in == nil { + return nil + } + out := new(WebHookConfig) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/bus/v1alpha1/actions.go b/pkg/apis/bus/v1alpha1/actions.go index f32be4ae..d5298bc3 100644 --- a/pkg/apis/bus/v1alpha1/actions.go +++ b/pkg/apis/bus/v1alpha1/actions.go @@ -48,6 +48,9 @@ const ( // ResumeJobAction is the action to resume an aborted job. ResumeJobAction Action = "ResumeJob" + // WebHookAction triggers a webhook call when event occurs. + WebHookAction Action = "WebHook" + // Note: actions below are only used internally, should not be used by users. // SyncJobAction is the action to sync Job/Pod status. diff --git a/pkg/apis/bus/v1alpha1/events.go b/pkg/apis/bus/v1alpha1/events.go index fc23efaf..a2742188 100644 --- a/pkg/apis/bus/v1alpha1/events.go +++ b/pkg/apis/bus/v1alpha1/events.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 // Event represent the phase of Job, e.g. pod-failed. -// +kubebuilder:validation:Enum=*;PodPending;PodRunning;PodFailed;PodEvicted;Unknown;TaskCompleted;OutOfSync;CommandIssued;JobUpdated;TaskFailed +// +kubebuilder:validation:Enum=*;PodPending;PodRunning;PodFailed;PodEvicted;Unknown;TaskCompleted;OutOfSync;CommandIssued;JobUpdated;TaskFailed;JobTerminated;JobCompleted;JobAborted;JobFailed type Event string const ( @@ -45,6 +45,18 @@ const ( // TaskCompletedEvent is triggered if the 'Replicas' amount of pods in one task are succeed TaskCompletedEvent Event = "TaskCompleted" + // JobTerminatedEvent is triggered when job is terminated + JobTerminatedEvent Event = "JobTerminated" + + // JobCompletedEvent is triggered when job is completed successfully + JobCompletedEvent Event = "JobCompleted" + + // JobAbortedEvent is triggered when job is aborted + JobAbortedEvent Event = "JobAborted" + + // JobFailedEvent is triggered when job failed permanently + JobFailedEvent Event = "JobFailed" + // Note: events below are used internally, should not be used by users. // OutOfSyncEvent is triggered if Pod/Job is updated(add/update/delete) diff --git a/pkg/client/applyconfiguration/batch/v1alpha1/lifecyclepolicy.go b/pkg/client/applyconfiguration/batch/v1alpha1/lifecyclepolicy.go index fb490b97..0dea0d64 100644 --- a/pkg/client/applyconfiguration/batch/v1alpha1/lifecyclepolicy.go +++ b/pkg/client/applyconfiguration/batch/v1alpha1/lifecyclepolicy.go @@ -25,11 +25,12 @@ import ( // LifecyclePolicyApplyConfiguration represents a declarative configuration of the LifecyclePolicy type for use // with apply. type LifecyclePolicyApplyConfiguration struct { - Action *busv1alpha1.Action `json:"action,omitempty"` - Event *busv1alpha1.Event `json:"event,omitempty"` - Events []busv1alpha1.Event `json:"events,omitempty"` - ExitCode *int32 `json:"exitCode,omitempty"` - Timeout *v1.Duration `json:"timeout,omitempty"` + Action *busv1alpha1.Action `json:"action,omitempty"` + Event *busv1alpha1.Event `json:"event,omitempty"` + Events []busv1alpha1.Event `json:"events,omitempty"` + ExitCode *int32 `json:"exitCode,omitempty"` + Timeout *v1.Duration `json:"timeout,omitempty"` + WebHookConfig *WebHookConfigApplyConfiguration `json:"webhookConfig,omitempty"` } // LifecyclePolicyApplyConfiguration constructs a declarative configuration of the LifecyclePolicy type for use with @@ -79,3 +80,11 @@ func (b *LifecyclePolicyApplyConfiguration) WithTimeout(value v1.Duration) *Life b.Timeout = &value return b } + +// WithWebHookConfig sets the WebHookConfig 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 WebHookConfig field is set to the value of the last call. +func (b *LifecyclePolicyApplyConfiguration) WithWebHookConfig(value *WebHookConfigApplyConfiguration) *LifecyclePolicyApplyConfiguration { + b.WebHookConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/batch/v1alpha1/networktopologyspec.go b/pkg/client/applyconfiguration/batch/v1alpha1/networktopologyspec.go index 2944b600..519432d6 100644 --- a/pkg/client/applyconfiguration/batch/v1alpha1/networktopologyspec.go +++ b/pkg/client/applyconfiguration/batch/v1alpha1/networktopologyspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1" + batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1" ) // NetworkTopologySpecApplyConfiguration represents a declarative configuration of the NetworkTopologySpec type for use // with apply. type NetworkTopologySpecApplyConfiguration struct { - Mode *v1alpha1.NetworkTopologyMode `json:"mode,omitempty"` - HighestTierAllowed *int `json:"highestTierAllowed,omitempty"` + Mode *batchv1alpha1.NetworkTopologyMode `json:"mode,omitempty"` + HighestTierAllowed *int `json:"highestTierAllowed,omitempty"` } // NetworkTopologySpecApplyConfiguration constructs a declarative configuration of the NetworkTopologySpec type for use with @@ -37,7 +37,7 @@ func NetworkTopologySpec() *NetworkTopologySpecApplyConfiguration { // WithMode sets the Mode 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 Mode field is set to the value of the last call. -func (b *NetworkTopologySpecApplyConfiguration) WithMode(value v1alpha1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration { +func (b *NetworkTopologySpecApplyConfiguration) WithMode(value batchv1alpha1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration { b.Mode = &value return b } diff --git a/pkg/client/applyconfiguration/batch/v1alpha1/webhookconfig.go b/pkg/client/applyconfiguration/batch/v1alpha1/webhookconfig.go new file mode 100644 index 00000000..c1fbf39c --- /dev/null +++ b/pkg/client/applyconfiguration/batch/v1alpha1/webhookconfig.go @@ -0,0 +1,89 @@ +/* +Copyright The Volcano Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// WebHookConfigApplyConfiguration represents a declarative configuration of the WebHookConfig type for use +// with apply. +type WebHookConfigApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Method *string `json:"method,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + Body *string `json:"body,omitempty"` + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + Retries *int32 `json:"retries,omitempty"` +} + +// WebHookConfigApplyConfiguration constructs a declarative configuration of the WebHookConfig type for use with +// apply. +func WebHookConfig() *WebHookConfigApplyConfiguration { + return &WebHookConfigApplyConfiguration{} +} + +// WithURL sets the URL 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 URL field is set to the value of the last call. +func (b *WebHookConfigApplyConfiguration) WithURL(value string) *WebHookConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithMethod sets the Method 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 Method field is set to the value of the last call. +func (b *WebHookConfigApplyConfiguration) WithMethod(value string) *WebHookConfigApplyConfiguration { + b.Method = &value + return b +} + +// WithHeaders puts the entries into the Headers 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 Headers field, +// overwriting an existing map entries in Headers field with the same key. +func (b *WebHookConfigApplyConfiguration) WithHeaders(entries map[string]string) *WebHookConfigApplyConfiguration { + if b.Headers == nil && len(entries) > 0 { + b.Headers = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Headers[k] = v + } + return b +} + +// WithBody sets the Body 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 Body field is set to the value of the last call. +func (b *WebHookConfigApplyConfiguration) WithBody(value string) *WebHookConfigApplyConfiguration { + b.Body = &value + return b +} + +// WithTimeoutSeconds sets the TimeoutSeconds 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 TimeoutSeconds field is set to the value of the last call. +func (b *WebHookConfigApplyConfiguration) WithTimeoutSeconds(value int32) *WebHookConfigApplyConfiguration { + b.TimeoutSeconds = &value + return b +} + +// WithRetries sets the Retries 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 Retries field is set to the value of the last call. +func (b *WebHookConfigApplyConfiguration) WithRetries(value int32) *WebHookConfigApplyConfiguration { + b.Retries = &value + return b +} diff --git a/pkg/client/applyconfiguration/scheduling/v1beta1/networktopologyspec.go b/pkg/client/applyconfiguration/scheduling/v1beta1/networktopologyspec.go index 887393ad..62f04543 100644 --- a/pkg/client/applyconfiguration/scheduling/v1beta1/networktopologyspec.go +++ b/pkg/client/applyconfiguration/scheduling/v1beta1/networktopologyspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 import ( - v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1" + schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1" ) // NetworkTopologySpecApplyConfiguration represents a declarative configuration of the NetworkTopologySpec type for use // with apply. type NetworkTopologySpecApplyConfiguration struct { - Mode *v1beta1.NetworkTopologyMode `json:"mode,omitempty"` - HighestTierAllowed *int `json:"highestTierAllowed,omitempty"` + Mode *schedulingv1beta1.NetworkTopologyMode `json:"mode,omitempty"` + HighestTierAllowed *int `json:"highestTierAllowed,omitempty"` } // NetworkTopologySpecApplyConfiguration constructs a declarative configuration of the NetworkTopologySpec type for use with @@ -37,7 +37,7 @@ func NetworkTopologySpec() *NetworkTopologySpecApplyConfiguration { // WithMode sets the Mode 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 Mode field is set to the value of the last call. -func (b *NetworkTopologySpecApplyConfiguration) WithMode(value v1beta1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration { +func (b *NetworkTopologySpecApplyConfiguration) WithMode(value schedulingv1beta1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration { b.Mode = &value return b } diff --git a/pkg/client/applyconfiguration/topology/v1alpha1/hypernode.go b/pkg/client/applyconfiguration/topology/v1alpha1/hypernode.go index b3c614f8..5eb08b71 100644 --- a/pkg/client/applyconfiguration/topology/v1alpha1/hypernode.go +++ b/pkg/client/applyconfiguration/topology/v1alpha1/hypernode.go @@ -46,7 +46,7 @@ func HyperNode(name string) *HyperNodeApplyConfiguration { // 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 *HyperNodeApplyConfiguration) WithKind(value string) *HyperNodeApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -54,7 +54,7 @@ func (b *HyperNodeApplyConfiguration) WithKind(value string) *HyperNodeApplyConf // 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 *HyperNodeApplyConfiguration) WithAPIVersion(value string) *HyperNodeApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -63,7 +63,7 @@ func (b *HyperNodeApplyConfiguration) WithAPIVersion(value string) *HyperNodeApp // If called multiple times, the Name field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithName(value string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -72,7 +72,7 @@ func (b *HyperNodeApplyConfiguration) WithName(value string) *HyperNodeApplyConf // If called multiple times, the GenerateName field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithGenerateName(value string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -81,7 +81,7 @@ func (b *HyperNodeApplyConfiguration) WithGenerateName(value string) *HyperNodeA // If called multiple times, the Namespace field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithNamespace(value string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -90,7 +90,7 @@ func (b *HyperNodeApplyConfiguration) WithNamespace(value string) *HyperNodeAppl // If called multiple times, the UID field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithUID(value types.UID) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -99,7 +99,7 @@ func (b *HyperNodeApplyConfiguration) WithUID(value types.UID) *HyperNodeApplyCo // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithResourceVersion(value string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -108,7 +108,7 @@ func (b *HyperNodeApplyConfiguration) WithResourceVersion(value string) *HyperNo // If called multiple times, the Generation field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithGeneration(value int64) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -117,7 +117,7 @@ func (b *HyperNodeApplyConfiguration) WithGeneration(value int64) *HyperNodeAppl // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -126,7 +126,7 @@ func (b *HyperNodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) * // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -135,7 +135,7 @@ func (b *HyperNodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) * // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *HyperNodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -145,11 +145,11 @@ func (b *HyperNodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64 // overwriting an existing map entries in Labels field with the same key. func (b *HyperNodeApplyConfiguration) WithLabels(entries map[string]string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -160,11 +160,11 @@ func (b *HyperNodeApplyConfiguration) WithLabels(entries map[string]string) *Hyp // overwriting an existing map entries in Annotations field with the same key. func (b *HyperNodeApplyConfiguration) WithAnnotations(entries map[string]string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -178,7 +178,7 @@ func (b *HyperNodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRef if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -189,7 +189,7 @@ func (b *HyperNodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRef func (b *HyperNodeApplyConfiguration) WithFinalizers(values ...string) *HyperNodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -219,5 +219,5 @@ func (b *HyperNodeApplyConfiguration) WithStatus(value *HyperNodeStatusApplyConf // GetName retrieves the value of the Name field in the declarative configuration. func (b *HyperNodeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/pkg/client/applyconfiguration/topology/v1alpha1/memberspec.go b/pkg/client/applyconfiguration/topology/v1alpha1/memberspec.go index 734f92a7..e3603511 100644 --- a/pkg/client/applyconfiguration/topology/v1alpha1/memberspec.go +++ b/pkg/client/applyconfiguration/topology/v1alpha1/memberspec.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" + topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" ) // MemberSpecApplyConfiguration represents a declarative configuration of the MemberSpec type for use // with apply. type MemberSpecApplyConfiguration struct { - Type *v1alpha1.MemberType `json:"type,omitempty"` + Type *topologyv1alpha1.MemberType `json:"type,omitempty"` Selector *MemberSelectorApplyConfiguration `json:"selector,omitempty"` } @@ -37,7 +37,7 @@ func MemberSpec() *MemberSpecApplyConfiguration { // WithType sets the Type 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 Type field is set to the value of the last call. -func (b *MemberSpecApplyConfiguration) WithType(value v1alpha1.MemberType) *MemberSpecApplyConfiguration { +func (b *MemberSpecApplyConfiguration) WithType(value topologyv1alpha1.MemberType) *MemberSpecApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index 44d95e94..f28f14d7 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -63,6 +63,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &batchv1alpha1.TaskStateApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("VolumeSpec"): return &batchv1alpha1.VolumeSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("WebHookConfig"): + return &batchv1alpha1.WebHookConfigApplyConfiguration{} // Group=bus.volcano.sh, Version=v1alpha1 case busv1alpha1.SchemeGroupVersion.WithKind("Command"): diff --git a/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_hypernode.go b/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_hypernode.go index 8ac6ca29..11ed17fd 100644 --- a/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_hypernode.go +++ b/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_hypernode.go @@ -18,168 +18,33 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" topologyv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/topology/v1alpha1" + typedtopologyv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/topology/v1alpha1" ) -// FakeHyperNodes implements HyperNodeInterface -type FakeHyperNodes struct { +// fakeHyperNodes implements HyperNodeInterface +type fakeHyperNodes struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.HyperNode, *v1alpha1.HyperNodeList, *topologyv1alpha1.HyperNodeApplyConfiguration] Fake *FakeTopologyV1alpha1 } -var hypernodesResource = v1alpha1.SchemeGroupVersion.WithResource("hypernodes") - -var hypernodesKind = v1alpha1.SchemeGroupVersion.WithKind("HyperNode") - -// Get takes name of the hyperNode, and returns the corresponding hyperNode object, and an error if there is any. -func (c *FakeHyperNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.HyperNode, err error) { - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(hypernodesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// List takes label and field selectors, and returns the list of HyperNodes that match those selectors. -func (c *FakeHyperNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.HyperNodeList, err error) { - emptyResult := &v1alpha1.HyperNodeList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(hypernodesResource, hypernodesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.HyperNodeList{ListMeta: obj.(*v1alpha1.HyperNodeList).ListMeta} - for _, item := range obj.(*v1alpha1.HyperNodeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested hyperNodes. -func (c *FakeHyperNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(hypernodesResource, opts)) -} - -// Create takes the representation of a hyperNode and creates it. Returns the server's representation of the hyperNode, and an error, if there is any. -func (c *FakeHyperNodes) Create(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.CreateOptions) (result *v1alpha1.HyperNode, err error) { - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(hypernodesResource, hyperNode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// Update takes the representation of a hyperNode and updates it. Returns the server's representation of the hyperNode, and an error, if there is any. -func (c *FakeHyperNodes) Update(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.UpdateOptions) (result *v1alpha1.HyperNode, err error) { - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(hypernodesResource, hyperNode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHyperNodes) UpdateStatus(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.UpdateOptions) (result *v1alpha1.HyperNode, err error) { - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(hypernodesResource, "status", hyperNode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// Delete takes name of the hyperNode and deletes it. Returns an error if one occurs. -func (c *FakeHyperNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(hypernodesResource, name, opts), &v1alpha1.HyperNode{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHyperNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(hypernodesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.HyperNodeList{}) - return err -} - -// Patch applies the patch and returns the patched hyperNode. -func (c *FakeHyperNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.HyperNode, err error) { - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(hypernodesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied hyperNode. -func (c *FakeHyperNodes) Apply(ctx context.Context, hyperNode *topologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.HyperNode, err error) { - if hyperNode == nil { - return nil, fmt.Errorf("hyperNode provided to Apply must not be nil") - } - data, err := json.Marshal(hyperNode) - if err != nil { - return nil, err - } - name := hyperNode.Name - if name == nil { - return nil, fmt.Errorf("hyperNode.Name must be provided to Apply") - } - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(hypernodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.HyperNode), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeHyperNodes) ApplyStatus(ctx context.Context, hyperNode *topologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.HyperNode, err error) { - if hyperNode == nil { - return nil, fmt.Errorf("hyperNode provided to Apply must not be nil") - } - data, err := json.Marshal(hyperNode) - if err != nil { - return nil, err - } - name := hyperNode.Name - if name == nil { - return nil, fmt.Errorf("hyperNode.Name must be provided to Apply") - } - emptyResult := &v1alpha1.HyperNode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(hypernodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeHyperNodes(fake *FakeTopologyV1alpha1) typedtopologyv1alpha1.HyperNodeInterface { + return &fakeHyperNodes{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.HyperNode, *v1alpha1.HyperNodeList, *topologyv1alpha1.HyperNodeApplyConfiguration]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("hypernodes"), + v1alpha1.SchemeGroupVersion.WithKind("HyperNode"), + func() *v1alpha1.HyperNode { return &v1alpha1.HyperNode{} }, + func() *v1alpha1.HyperNodeList { return &v1alpha1.HyperNodeList{} }, + func(dst, src *v1alpha1.HyperNodeList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.HyperNodeList) []*v1alpha1.HyperNode { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.HyperNodeList, items []*v1alpha1.HyperNode) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.HyperNode), err } diff --git a/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_topology_client.go b/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_topology_client.go index 6e870b7f..84397c6d 100644 --- a/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_topology_client.go +++ b/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake/fake_topology_client.go @@ -28,7 +28,7 @@ type FakeTopologyV1alpha1 struct { } func (c *FakeTopologyV1alpha1) HyperNodes() v1alpha1.HyperNodeInterface { - return &FakeHyperNodes{c} + return newFakeHyperNodes(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset/versioned/typed/topology/v1alpha1/hypernode.go b/pkg/client/clientset/versioned/typed/topology/v1alpha1/hypernode.go index ebab1c0d..8b31df97 100644 --- a/pkg/client/clientset/versioned/typed/topology/v1alpha1/hypernode.go +++ b/pkg/client/clientset/versioned/typed/topology/v1alpha1/hypernode.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" - topologyv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/topology/v1alpha1" + topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" + applyconfigurationtopologyv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/topology/v1alpha1" scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme" ) @@ -37,36 +37,37 @@ type HyperNodesGetter interface { // HyperNodeInterface has methods to work with HyperNode resources. type HyperNodeInterface interface { - Create(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.CreateOptions) (*v1alpha1.HyperNode, error) - Update(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.UpdateOptions) (*v1alpha1.HyperNode, error) + Create(ctx context.Context, hyperNode *topologyv1alpha1.HyperNode, opts v1.CreateOptions) (*topologyv1alpha1.HyperNode, error) + Update(ctx context.Context, hyperNode *topologyv1alpha1.HyperNode, opts v1.UpdateOptions) (*topologyv1alpha1.HyperNode, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, hyperNode *v1alpha1.HyperNode, opts v1.UpdateOptions) (*v1alpha1.HyperNode, error) + UpdateStatus(ctx context.Context, hyperNode *topologyv1alpha1.HyperNode, opts v1.UpdateOptions) (*topologyv1alpha1.HyperNode, 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) (*v1alpha1.HyperNode, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.HyperNodeList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*topologyv1alpha1.HyperNode, error) + List(ctx context.Context, opts v1.ListOptions) (*topologyv1alpha1.HyperNodeList, 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 *v1alpha1.HyperNode, err error) - Apply(ctx context.Context, hyperNode *topologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.HyperNode, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *topologyv1alpha1.HyperNode, err error) + Apply(ctx context.Context, hyperNode *applyconfigurationtopologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *topologyv1alpha1.HyperNode, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, hyperNode *topologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.HyperNode, err error) + ApplyStatus(ctx context.Context, hyperNode *applyconfigurationtopologyv1alpha1.HyperNodeApplyConfiguration, opts v1.ApplyOptions) (result *topologyv1alpha1.HyperNode, err error) HyperNodeExpansion } // hyperNodes implements HyperNodeInterface type hyperNodes struct { - *gentype.ClientWithListAndApply[*v1alpha1.HyperNode, *v1alpha1.HyperNodeList, *topologyv1alpha1.HyperNodeApplyConfiguration] + *gentype.ClientWithListAndApply[*topologyv1alpha1.HyperNode, *topologyv1alpha1.HyperNodeList, *applyconfigurationtopologyv1alpha1.HyperNodeApplyConfiguration] } // newHyperNodes returns a HyperNodes func newHyperNodes(c *TopologyV1alpha1Client) *hyperNodes { return &hyperNodes{ - gentype.NewClientWithListAndApply[*v1alpha1.HyperNode, *v1alpha1.HyperNodeList, *topologyv1alpha1.HyperNodeApplyConfiguration]( + gentype.NewClientWithListAndApply[*topologyv1alpha1.HyperNode, *topologyv1alpha1.HyperNodeList, *applyconfigurationtopologyv1alpha1.HyperNodeApplyConfiguration]( "hypernodes", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha1.HyperNode { return &v1alpha1.HyperNode{} }, - func() *v1alpha1.HyperNodeList { return &v1alpha1.HyperNodeList{} }), + func() *topologyv1alpha1.HyperNode { return &topologyv1alpha1.HyperNode{} }, + func() *topologyv1alpha1.HyperNodeList { return &topologyv1alpha1.HyperNodeList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/topology/v1alpha1/topology_client.go b/pkg/client/clientset/versioned/typed/topology/v1alpha1/topology_client.go index 69248e47..f886bad9 100644 --- a/pkg/client/clientset/versioned/typed/topology/v1alpha1/topology_client.go +++ b/pkg/client/clientset/versioned/typed/topology/v1alpha1/topology_client.go @@ -18,11 +18,11 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" rest "k8s.io/client-go/rest" - v1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" - "volcano.sh/apis/pkg/client/clientset/versioned/scheme" + topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" + scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme" ) type TopologyV1alpha1Interface interface { @@ -84,10 +84,10 @@ func New(c rest.Interface) *TopologyV1alpha1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := topologyv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/informers/externalversions/topology/v1alpha1/hypernode.go b/pkg/client/informers/externalversions/topology/v1alpha1/hypernode.go index 52262e56..43e332c5 100644 --- a/pkg/client/informers/externalversions/topology/v1alpha1/hypernode.go +++ b/pkg/client/informers/externalversions/topology/v1alpha1/hypernode.go @@ -18,24 +18,24 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" + apistopologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" versioned "volcano.sh/apis/pkg/client/clientset/versioned" internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "volcano.sh/apis/pkg/client/listers/topology/v1alpha1" + topologyv1alpha1 "volcano.sh/apis/pkg/client/listers/topology/v1alpha1" ) // HyperNodeInformer provides access to a shared informer and lister for // HyperNodes. type HyperNodeInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.HyperNodeLister + Lister() topologyv1alpha1.HyperNodeLister } type hyperNodeInformer struct { @@ -69,7 +69,7 @@ func NewFilteredHyperNodeInformer(client versioned.Interface, resyncPeriod time. return client.TopologyV1alpha1().HyperNodes().Watch(context.TODO(), options) }, }, - &topologyv1alpha1.HyperNode{}, + &apistopologyv1alpha1.HyperNode{}, resyncPeriod, indexers, ) @@ -80,9 +80,9 @@ func (f *hyperNodeInformer) defaultInformer(client versioned.Interface, resyncPe } func (f *hyperNodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&topologyv1alpha1.HyperNode{}, f.defaultInformer) + return f.factory.InformerFor(&apistopologyv1alpha1.HyperNode{}, f.defaultInformer) } -func (f *hyperNodeInformer) Lister() v1alpha1.HyperNodeLister { - return v1alpha1.NewHyperNodeLister(f.Informer().GetIndexer()) +func (f *hyperNodeInformer) Lister() topologyv1alpha1.HyperNodeLister { + return topologyv1alpha1.NewHyperNodeLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/listers/topology/v1alpha1/hypernode.go b/pkg/client/listers/topology/v1alpha1/hypernode.go index 9361b3f4..7c36012f 100644 --- a/pkg/client/listers/topology/v1alpha1/hypernode.go +++ b/pkg/client/listers/topology/v1alpha1/hypernode.go @@ -18,10 +18,10 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1" ) // HyperNodeLister helps list HyperNodes. @@ -29,19 +29,19 @@ import ( type HyperNodeLister interface { // List lists all HyperNodes in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.HyperNode, err error) + List(selector labels.Selector) (ret []*topologyv1alpha1.HyperNode, err error) // Get retrieves the HyperNode from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.HyperNode, error) + Get(name string) (*topologyv1alpha1.HyperNode, error) HyperNodeListerExpansion } // hyperNodeLister implements the HyperNodeLister interface. type hyperNodeLister struct { - listers.ResourceIndexer[*v1alpha1.HyperNode] + listers.ResourceIndexer[*topologyv1alpha1.HyperNode] } // NewHyperNodeLister returns a new HyperNodeLister. func NewHyperNodeLister(indexer cache.Indexer) HyperNodeLister { - return &hyperNodeLister{listers.New[*v1alpha1.HyperNode](indexer, v1alpha1.Resource("hypernode"))} + return &hyperNodeLister{listers.New[*topologyv1alpha1.HyperNode](indexer, topologyv1alpha1.Resource("hypernode"))} }