Merge pull request #147 from Monokaix/dev

Auto generate code
This commit is contained in:
Volcano Bot 2024-12-13 14:56:31 +08:00 committed by GitHub
commit 7e0a058f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
67 changed files with 453 additions and 1668 deletions

View File

@ -21,14 +21,14 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// DependsOnApplyConfiguration represents an declarative configuration of the DependsOn type for use
// DependsOnApplyConfiguration represents a declarative configuration of the DependsOn type for use
// with apply.
type DependsOnApplyConfiguration struct {
Name []string `json:"name,omitempty"`
Iteration *v1alpha1.Iteration `json:"iteration,omitempty"`
}
// DependsOnApplyConfiguration constructs an declarative configuration of the DependsOn type for use with
// DependsOnApplyConfiguration constructs a declarative configuration of the DependsOn type for use with
// apply.
func DependsOn() *DependsOnApplyConfiguration {
return &DependsOnApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// JobApplyConfiguration represents an declarative configuration of the Job type for use
// JobApplyConfiguration represents a declarative configuration of the Job type for use
// with apply.
type JobApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -32,7 +32,7 @@ type JobApplyConfiguration struct {
Status *JobStatusApplyConfiguration `json:"status,omitempty"`
}
// Job constructs an declarative configuration of the Job type for use with
// Job constructs a declarative configuration of the Job type for use with
// apply.
func Job(name, namespace string) *JobApplyConfiguration {
b := &JobApplyConfiguration{}
@ -216,3 +216,9 @@ func (b *JobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration) *
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -22,14 +22,14 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobConditionApplyConfiguration represents an declarative configuration of the JobCondition type for use
// JobConditionApplyConfiguration represents a declarative configuration of the JobCondition type for use
// with apply.
type JobConditionApplyConfiguration struct {
Status *v1alpha1.JobPhase `json:"status,omitempty"`
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
}
// JobConditionApplyConfiguration constructs an declarative configuration of the JobCondition type for use with
// JobConditionApplyConfiguration constructs a declarative configuration of the JobCondition type for use with
// apply.
func JobCondition() *JobConditionApplyConfiguration {
return &JobConditionApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JobSpecApplyConfiguration represents an declarative configuration of the JobSpec type for use
// JobSpecApplyConfiguration represents a declarative configuration of the JobSpec type for use
// with apply.
type JobSpecApplyConfiguration struct {
SchedulerName *string `json:"schedulerName,omitempty"`
@ -38,7 +38,7 @@ type JobSpecApplyConfiguration struct {
MinSuccess *int32 `json:"minSuccess,omitempty"`
}
// JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
// JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with
// apply.
func JobSpec() *JobSpecApplyConfiguration {
return &JobSpecApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobStateApplyConfiguration represents an declarative configuration of the JobState type for use
// JobStateApplyConfiguration represents a declarative configuration of the JobState type for use
// with apply.
type JobStateApplyConfiguration struct {
Phase *v1alpha1.JobPhase `json:"phase,omitempty"`
@ -31,7 +31,7 @@ type JobStateApplyConfiguration struct {
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
}
// JobStateApplyConfiguration constructs an declarative configuration of the JobState type for use with
// JobStateApplyConfiguration constructs a declarative configuration of the JobState type for use with
// apply.
func JobState() *JobStateApplyConfiguration {
return &JobStateApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use
// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use
// with apply.
type JobStatusApplyConfiguration struct {
State *JobStateApplyConfiguration `json:"state,omitempty"`
@ -40,7 +40,7 @@ type JobStatusApplyConfiguration struct {
Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"`
}
// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with
// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with
// apply.
func JobStatus() *JobStatusApplyConfiguration {
return &JobStatusApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
)
// LifecyclePolicyApplyConfiguration represents an declarative configuration of the LifecyclePolicy type for use
// LifecyclePolicyApplyConfiguration represents a declarative configuration of the LifecyclePolicy type for use
// with apply.
type LifecyclePolicyApplyConfiguration struct {
Action *v1alpha1.Action `json:"action,omitempty"`
@ -32,7 +32,7 @@ type LifecyclePolicyApplyConfiguration struct {
Timeout *v1.Duration `json:"timeout,omitempty"`
}
// LifecyclePolicyApplyConfiguration constructs an declarative configuration of the LifecyclePolicy type for use with
// LifecyclePolicyApplyConfiguration constructs a declarative configuration of the LifecyclePolicy type for use with
// apply.
func LifecyclePolicy() *LifecyclePolicyApplyConfiguration {
return &LifecyclePolicyApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// TaskSpecApplyConfiguration represents an declarative configuration of the TaskSpec type for use
// TaskSpecApplyConfiguration represents a declarative configuration of the TaskSpec type for use
// with apply.
type TaskSpecApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@ -35,7 +35,7 @@ type TaskSpecApplyConfiguration struct {
DependsOn *DependsOnApplyConfiguration `json:"dependsOn,omitempty"`
}
// TaskSpecApplyConfiguration constructs an declarative configuration of the TaskSpec type for use with
// TaskSpecApplyConfiguration constructs a declarative configuration of the TaskSpec type for use with
// apply.
func TaskSpec() *TaskSpecApplyConfiguration {
return &TaskSpecApplyConfiguration{}

View File

@ -21,13 +21,13 @@ import (
v1 "k8s.io/api/core/v1"
)
// TaskStateApplyConfiguration represents an declarative configuration of the TaskState type for use
// TaskStateApplyConfiguration represents a declarative configuration of the TaskState type for use
// with apply.
type TaskStateApplyConfiguration struct {
Phase map[v1.PodPhase]int32 `json:"phase,omitempty"`
}
// TaskStateApplyConfiguration constructs an declarative configuration of the TaskState type for use with
// TaskStateApplyConfiguration constructs a declarative configuration of the TaskState type for use with
// apply.
func TaskState() *TaskStateApplyConfiguration {
return &TaskStateApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
// VolumeSpecApplyConfiguration represents an declarative configuration of the VolumeSpec type for use
// VolumeSpecApplyConfiguration represents a declarative configuration of the VolumeSpec type for use
// with apply.
type VolumeSpecApplyConfiguration struct {
MountPath *string `json:"mountPath,omitempty"`
@ -29,7 +29,7 @@ type VolumeSpecApplyConfiguration struct {
VolumeClaim *v1.PersistentVolumeClaimSpec `json:"volumeClaim,omitempty"`
}
// VolumeSpecApplyConfiguration constructs an declarative configuration of the VolumeSpec type for use with
// VolumeSpecApplyConfiguration constructs a declarative configuration of the VolumeSpec type for use with
// apply.
func VolumeSpec() *VolumeSpecApplyConfiguration {
return &VolumeSpecApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// CommandApplyConfiguration represents an declarative configuration of the Command type for use
// CommandApplyConfiguration represents a declarative configuration of the Command type for use
// with apply.
type CommandApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -34,7 +34,7 @@ type CommandApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
// Command constructs an declarative configuration of the Command type for use with
// Command constructs a declarative configuration of the Command type for use with
// apply.
func Command(name, namespace string) *CommandApplyConfiguration {
b := &CommandApplyConfiguration{}
@ -234,3 +234,9 @@ func (b *CommandApplyConfiguration) WithMessage(value string) *CommandApplyConfi
b.Message = &value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *CommandApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -23,7 +23,7 @@ import (
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
)
// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use
// ConditionApplyConfiguration represents a declarative configuration of the Condition type for use
// with apply.
type ConditionApplyConfiguration struct {
Phase *v1alpha1.JobPhase `json:"phase,omitempty"`
@ -32,7 +32,7 @@ type ConditionApplyConfiguration struct {
TaskStatusCount map[string]batchv1alpha1.TaskStateApplyConfiguration `json:"taskStatusCount,omitempty"`
}
// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with
// ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with
// apply.
func Condition() *ConditionApplyConfiguration {
return &ConditionApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// DependsOnApplyConfiguration represents an declarative configuration of the DependsOn type for use
// DependsOnApplyConfiguration represents a declarative configuration of the DependsOn type for use
// with apply.
type DependsOnApplyConfiguration struct {
Targets []string `json:"targets,omitempty"`
Probe *ProbeApplyConfiguration `json:"probe,omitempty"`
}
// DependsOnApplyConfiguration constructs an declarative configuration of the DependsOn type for use with
// DependsOnApplyConfiguration constructs a declarative configuration of the DependsOn type for use with
// apply.
func DependsOn() *DependsOnApplyConfiguration {
return &DependsOnApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// FlowApplyConfiguration represents an declarative configuration of the Flow type for use
// FlowApplyConfiguration represents a declarative configuration of the Flow type for use
// with apply.
type FlowApplyConfiguration struct {
Name *string `json:"name,omitempty"`
DependsOn *DependsOnApplyConfiguration `json:"dependsOn,omitempty"`
}
// FlowApplyConfiguration constructs an declarative configuration of the Flow type for use with
// FlowApplyConfiguration constructs a declarative configuration of the Flow type for use with
// apply.
func Flow() *FlowApplyConfiguration {
return &FlowApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
// HttpGetApplyConfiguration represents an declarative configuration of the HttpGet type for use
// HttpGetApplyConfiguration represents a declarative configuration of the HttpGet type for use
// with apply.
type HttpGetApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
@ -30,7 +30,7 @@ type HttpGetApplyConfiguration struct {
HTTPHeader *v1.HTTPHeader `json:"httpHeader,omitempty"`
}
// HttpGetApplyConfiguration constructs an declarative configuration of the HttpGet type for use with
// HttpGetApplyConfiguration constructs a declarative configuration of the HttpGet type for use with
// apply.
func HttpGet() *HttpGetApplyConfiguration {
return &HttpGetApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// JobFlowApplyConfiguration represents an declarative configuration of the JobFlow type for use
// JobFlowApplyConfiguration represents a declarative configuration of the JobFlow type for use
// with apply.
type JobFlowApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -32,7 +32,7 @@ type JobFlowApplyConfiguration struct {
Status *JobFlowStatusApplyConfiguration `json:"status,omitempty"`
}
// JobFlow constructs an declarative configuration of the JobFlow type for use with
// JobFlow constructs a declarative configuration of the JobFlow type for use with
// apply.
func JobFlow(name, namespace string) *JobFlowApplyConfiguration {
b := &JobFlowApplyConfiguration{}
@ -216,3 +216,9 @@ func (b *JobFlowApplyConfiguration) WithStatus(value *JobFlowStatusApplyConfigur
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobFlowApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// JobFlowSpecApplyConfiguration represents an declarative configuration of the JobFlowSpec type for use
// JobFlowSpecApplyConfiguration represents a declarative configuration of the JobFlowSpec type for use
// with apply.
type JobFlowSpecApplyConfiguration struct {
Flows []FlowApplyConfiguration `json:"flows,omitempty"`
JobRetainPolicy *string `json:"jobRetainPolicy,omitempty"`
}
// JobFlowSpecApplyConfiguration constructs an declarative configuration of the JobFlowSpec type for use with
// JobFlowSpecApplyConfiguration constructs a declarative configuration of the JobFlowSpec type for use with
// apply.
func JobFlowSpec() *JobFlowSpecApplyConfiguration {
return &JobFlowSpecApplyConfiguration{}

View File

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1
// JobFlowStatusApplyConfiguration represents an declarative configuration of the JobFlowStatus type for use
// JobFlowStatusApplyConfiguration represents a declarative configuration of the JobFlowStatus type for use
// with apply.
type JobFlowStatusApplyConfiguration struct {
PendingJobs []string `json:"pendingJobs,omitempty"`
@ -31,7 +31,7 @@ type JobFlowStatusApplyConfiguration struct {
State *StateApplyConfiguration `json:"state,omitempty"`
}
// JobFlowStatusApplyConfiguration constructs an declarative configuration of the JobFlowStatus type for use with
// JobFlowStatusApplyConfiguration constructs a declarative configuration of the JobFlowStatus type for use with
// apply.
func JobFlowStatus() *JobFlowStatusApplyConfiguration {
return &JobFlowStatusApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobRunningHistoryApplyConfiguration represents an declarative configuration of the JobRunningHistory type for use
// JobRunningHistoryApplyConfiguration represents a declarative configuration of the JobRunningHistory type for use
// with apply.
type JobRunningHistoryApplyConfiguration struct {
StartTimestamp *v1.Time `json:"startTimestamp,omitempty"`
@ -30,7 +30,7 @@ type JobRunningHistoryApplyConfiguration struct {
State *v1alpha1.JobPhase `json:"state,omitempty"`
}
// JobRunningHistoryApplyConfiguration constructs an declarative configuration of the JobRunningHistory type for use with
// JobRunningHistoryApplyConfiguration constructs a declarative configuration of the JobRunningHistory type for use with
// apply.
func JobRunningHistory() *JobRunningHistoryApplyConfiguration {
return &JobRunningHistoryApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use
// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use
// with apply.
type JobStatusApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@ -33,7 +33,7 @@ type JobStatusApplyConfiguration struct {
RunningHistories []JobRunningHistoryApplyConfiguration `json:"runningHistories,omitempty"`
}
// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with
// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with
// apply.
func JobStatus() *JobStatusApplyConfiguration {
return &JobStatusApplyConfiguration{}

View File

@ -24,7 +24,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
)
// JobTemplateApplyConfiguration represents an declarative configuration of the JobTemplate type for use
// JobTemplateApplyConfiguration represents a declarative configuration of the JobTemplate type for use
// with apply.
type JobTemplateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -33,7 +33,7 @@ type JobTemplateApplyConfiguration struct {
Status *JobTemplateStatusApplyConfiguration `json:"status,omitempty"`
}
// JobTemplate constructs an declarative configuration of the JobTemplate type for use with
// JobTemplate constructs a declarative configuration of the JobTemplate type for use with
// apply.
func JobTemplate(name, namespace string) *JobTemplateApplyConfiguration {
b := &JobTemplateApplyConfiguration{}
@ -217,3 +217,9 @@ func (b *JobTemplateApplyConfiguration) WithStatus(value *JobTemplateStatusApply
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobTemplateApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -17,13 +17,13 @@ limitations under the License.
package v1alpha1
// JobTemplateStatusApplyConfiguration represents an declarative configuration of the JobTemplateStatus type for use
// JobTemplateStatusApplyConfiguration represents a declarative configuration of the JobTemplateStatus type for use
// with apply.
type JobTemplateStatusApplyConfiguration struct {
JobDependsOnList []string `json:"jobDependsOnList,omitempty"`
}
// JobTemplateStatusApplyConfiguration constructs an declarative configuration of the JobTemplateStatus type for use with
// JobTemplateStatusApplyConfiguration constructs a declarative configuration of the JobTemplateStatus type for use with
// apply.
func JobTemplateStatus() *JobTemplateStatusApplyConfiguration {
return &JobTemplateStatusApplyConfiguration{}

View File

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1
// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use
// ProbeApplyConfiguration represents a declarative configuration of the Probe type for use
// with apply.
type ProbeApplyConfiguration struct {
HttpGetList []HttpGetApplyConfiguration `json:"httpGetList,omitempty"`
@ -25,7 +25,7 @@ type ProbeApplyConfiguration struct {
TaskStatusList []TaskStatusApplyConfiguration `json:"taskStatusList,omitempty"`
}
// ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with
// ProbeApplyConfiguration constructs a declarative configuration of the Probe type for use with
// apply.
func Probe() *ProbeApplyConfiguration {
return &ProbeApplyConfiguration{}

View File

@ -21,13 +21,13 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
// StateApplyConfiguration represents an declarative configuration of the State type for use
// StateApplyConfiguration represents a declarative configuration of the State type for use
// with apply.
type StateApplyConfiguration struct {
Phase *v1alpha1.Phase `json:"phase,omitempty"`
}
// StateApplyConfiguration constructs an declarative configuration of the State type for use with
// StateApplyConfiguration constructs a declarative configuration of the State type for use with
// apply.
func State() *StateApplyConfiguration {
return &StateApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// TaskStatusApplyConfiguration represents an declarative configuration of the TaskStatus type for use
// TaskStatusApplyConfiguration represents a declarative configuration of the TaskStatus type for use
// with apply.
type TaskStatusApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
Phase *string `json:"phase,omitempty"`
}
// TaskStatusApplyConfiguration constructs an declarative configuration of the TaskStatus type for use with
// TaskStatusApplyConfiguration constructs a declarative configuration of the TaskStatus type for use with
// apply.
func TaskStatus() *TaskStatusApplyConfiguration {
return &TaskStatusApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// TcpSocketApplyConfiguration represents an declarative configuration of the TcpSocket type for use
// TcpSocketApplyConfiguration represents a declarative configuration of the TcpSocket type for use
// with apply.
type TcpSocketApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
Port *int `json:"port,omitempty"`
}
// TcpSocketApplyConfiguration constructs an declarative configuration of the TcpSocket type for use with
// TcpSocketApplyConfiguration constructs a declarative configuration of the TcpSocket type for use with
// apply.
func TcpSocket() *TcpSocketApplyConfiguration {
return &TcpSocketApplyConfiguration{}

View File

@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1
// CPUInfoApplyConfiguration represents an declarative configuration of the CPUInfo type for use
// CPUInfoApplyConfiguration represents a declarative configuration of the CPUInfo type for use
// with apply.
type CPUInfoApplyConfiguration struct {
NUMANodeID *int `json:"numa,omitempty"`
@ -25,7 +25,7 @@ type CPUInfoApplyConfiguration struct {
CoreID *int `json:"core,omitempty"`
}
// CPUInfoApplyConfiguration constructs an declarative configuration of the CPUInfo type for use with
// CPUInfoApplyConfiguration constructs a declarative configuration of the CPUInfo type for use with
// apply.
func CPUInfo() *CPUInfoApplyConfiguration {
return &CPUInfoApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// NumatopologyApplyConfiguration represents an declarative configuration of the Numatopology type for use
// NumatopologyApplyConfiguration represents a declarative configuration of the Numatopology type for use
// with apply.
type NumatopologyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -31,7 +31,7 @@ type NumatopologyApplyConfiguration struct {
Spec *NumatopoSpecApplyConfiguration `json:"spec,omitempty"`
}
// Numatopology constructs an declarative configuration of the Numatopology type for use with
// Numatopology constructs a declarative configuration of the Numatopology type for use with
// apply.
func Numatopology(name string) *NumatopologyApplyConfiguration {
b := &NumatopologyApplyConfiguration{}
@ -206,3 +206,9 @@ func (b *NumatopologyApplyConfiguration) WithSpec(value *NumatopoSpecApplyConfig
b.Spec = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *NumatopologyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -21,7 +21,7 @@ import (
v1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
)
// NumatopoSpecApplyConfiguration represents an declarative configuration of the NumatopoSpec type for use
// NumatopoSpecApplyConfiguration represents a declarative configuration of the NumatopoSpec type for use
// with apply.
type NumatopoSpecApplyConfiguration struct {
Policies map[v1alpha1.PolicyName]string `json:"policies,omitempty"`
@ -30,7 +30,7 @@ type NumatopoSpecApplyConfiguration struct {
CPUDetail map[string]CPUInfoApplyConfiguration `json:"cpuDetail,omitempty"`
}
// NumatopoSpecApplyConfiguration constructs an declarative configuration of the NumatopoSpec type for use with
// NumatopoSpecApplyConfiguration constructs a declarative configuration of the NumatopoSpec type for use with
// apply.
func NumatopoSpec() *NumatopoSpecApplyConfiguration {
return &NumatopoSpecApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1alpha1
// ResourceInfoApplyConfiguration represents an declarative configuration of the ResourceInfo type for use
// ResourceInfoApplyConfiguration represents a declarative configuration of the ResourceInfo type for use
// with apply.
type ResourceInfoApplyConfiguration struct {
Allocatable *string `json:"allocatable,omitempty"`
Capacity *int `json:"capacity,omitempty"`
}
// ResourceInfoApplyConfiguration constructs an declarative configuration of the ResourceInfo type for use with
// ResourceInfoApplyConfiguration constructs a declarative configuration of the ResourceInfo type for use with
// apply.
func ResourceInfo() *ResourceInfoApplyConfiguration {
return &ResourceInfoApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1beta1
// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
// AffinityApplyConfiguration represents a declarative configuration of the Affinity type for use
// with apply.
type AffinityApplyConfiguration struct {
NodeGroupAffinity *NodeGroupAffinityApplyConfiguration `json:"nodeGroupAffinity,omitempty"`
NodeGroupAntiAffinity *NodeGroupAntiAffinityApplyConfiguration `json:"nodeGroupAntiAffinity,omitempty"`
}
// AffinityApplyConfiguration constructs an declarative configuration of the Affinity type for use with
// AffinityApplyConfiguration constructs a declarative configuration of the Affinity type for use with
// apply.
func Affinity() *AffinityApplyConfiguration {
return &AffinityApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
// ClusterApplyConfiguration represents an declarative configuration of the Cluster type for use
// ClusterApplyConfiguration represents a declarative configuration of the Cluster type for use
// with apply.
type ClusterApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@ -29,7 +29,7 @@ type ClusterApplyConfiguration struct {
Capacity *v1.ResourceList `json:"capacity,omitempty"`
}
// ClusterApplyConfiguration constructs an declarative configuration of the Cluster type for use with
// ClusterApplyConfiguration constructs a declarative configuration of the Cluster type for use with
// apply.
func Cluster() *ClusterApplyConfiguration {
return &ClusterApplyConfiguration{}

View File

@ -21,13 +21,13 @@ import (
v1 "k8s.io/api/core/v1"
)
// GuaranteeApplyConfiguration represents an declarative configuration of the Guarantee type for use
// GuaranteeApplyConfiguration represents a declarative configuration of the Guarantee type for use
// with apply.
type GuaranteeApplyConfiguration struct {
Resource *v1.ResourceList `json:"resource,omitempty"`
}
// GuaranteeApplyConfiguration constructs an declarative configuration of the Guarantee type for use with
// GuaranteeApplyConfiguration constructs a declarative configuration of the Guarantee type for use with
// apply.
func Guarantee() *GuaranteeApplyConfiguration {
return &GuaranteeApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1beta1
// NodeGroupAffinityApplyConfiguration represents an declarative configuration of the NodeGroupAffinity type for use
// NodeGroupAffinityApplyConfiguration represents a declarative configuration of the NodeGroupAffinity type for use
// with apply.
type NodeGroupAffinityApplyConfiguration struct {
RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
// NodeGroupAffinityApplyConfiguration constructs an declarative configuration of the NodeGroupAffinity type for use with
// NodeGroupAffinityApplyConfiguration constructs a declarative configuration of the NodeGroupAffinity type for use with
// apply.
func NodeGroupAffinity() *NodeGroupAffinityApplyConfiguration {
return &NodeGroupAffinityApplyConfiguration{}

View File

@ -17,14 +17,14 @@ limitations under the License.
package v1beta1
// NodeGroupAntiAffinityApplyConfiguration represents an declarative configuration of the NodeGroupAntiAffinity type for use
// NodeGroupAntiAffinityApplyConfiguration represents a declarative configuration of the NodeGroupAntiAffinity type for use
// with apply.
type NodeGroupAntiAffinityApplyConfiguration struct {
RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
// NodeGroupAntiAffinityApplyConfiguration constructs an declarative configuration of the NodeGroupAntiAffinity type for use with
// NodeGroupAntiAffinityApplyConfiguration constructs a declarative configuration of the NodeGroupAntiAffinity type for use with
// apply.
func NodeGroupAntiAffinity() *NodeGroupAntiAffinityApplyConfiguration {
return &NodeGroupAntiAffinityApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// PodGroupApplyConfiguration represents an declarative configuration of the PodGroup type for use
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
// with apply.
type PodGroupApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -32,7 +32,7 @@ type PodGroupApplyConfiguration struct {
Status *PodGroupStatusApplyConfiguration `json:"status,omitempty"`
}
// PodGroup constructs an declarative configuration of the PodGroup type for use with
// PodGroup constructs a declarative configuration of the PodGroup type for use with
// apply.
func PodGroup(name, namespace string) *PodGroupApplyConfiguration {
b := &PodGroupApplyConfiguration{}
@ -216,3 +216,9 @@ func (b *PodGroupApplyConfiguration) WithStatus(value *PodGroupStatusApplyConfig
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *PodGroupApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -23,7 +23,7 @@ import (
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// PodGroupConditionApplyConfiguration represents an declarative configuration of the PodGroupCondition type for use
// PodGroupConditionApplyConfiguration represents a declarative configuration of the PodGroupCondition type for use
// with apply.
type PodGroupConditionApplyConfiguration struct {
Type *v1beta1.PodGroupConditionType `json:"type,omitempty"`
@ -34,7 +34,7 @@ type PodGroupConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
// PodGroupConditionApplyConfiguration constructs an declarative configuration of the PodGroupCondition type for use with
// PodGroupConditionApplyConfiguration constructs a declarative configuration of the PodGroupCondition type for use with
// apply.
func PodGroupCondition() *PodGroupConditionApplyConfiguration {
return &PodGroupConditionApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
// PodGroupSpecApplyConfiguration represents an declarative configuration of the PodGroupSpec type for use
// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use
// with apply.
type PodGroupSpecApplyConfiguration struct {
MinMember *int32 `json:"minMember,omitempty"`
@ -31,7 +31,7 @@ type PodGroupSpecApplyConfiguration struct {
MinResources *v1.ResourceList `json:"minResources,omitempty"`
}
// PodGroupSpecApplyConfiguration constructs an declarative configuration of the PodGroupSpec type for use with
// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with
// apply.
func PodGroupSpec() *PodGroupSpecApplyConfiguration {
return &PodGroupSpecApplyConfiguration{}

View File

@ -21,7 +21,7 @@ import (
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// PodGroupStatusApplyConfiguration represents an declarative configuration of the PodGroupStatus type for use
// PodGroupStatusApplyConfiguration represents a declarative configuration of the PodGroupStatus type for use
// with apply.
type PodGroupStatusApplyConfiguration struct {
Phase *v1beta1.PodGroupPhase `json:"phase,omitempty"`
@ -31,7 +31,7 @@ type PodGroupStatusApplyConfiguration struct {
Failed *int32 `json:"failed,omitempty"`
}
// PodGroupStatusApplyConfiguration constructs an declarative configuration of the PodGroupStatus type for use with
// PodGroupStatusApplyConfiguration constructs a declarative configuration of the PodGroupStatus type for use with
// apply.
func PodGroupStatus() *PodGroupStatusApplyConfiguration {
return &PodGroupStatusApplyConfiguration{}

View File

@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// QueueApplyConfiguration represents an declarative configuration of the Queue type for use
// QueueApplyConfiguration represents a declarative configuration of the Queue type for use
// with apply.
type QueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@ -32,7 +32,7 @@ type QueueApplyConfiguration struct {
Status *QueueStatusApplyConfiguration `json:"status,omitempty"`
}
// Queue constructs an declarative configuration of the Queue type for use with
// Queue constructs a declarative configuration of the Queue type for use with
// apply.
func Queue(name string) *QueueApplyConfiguration {
b := &QueueApplyConfiguration{}
@ -215,3 +215,9 @@ func (b *QueueApplyConfiguration) WithStatus(value *QueueStatusApplyConfiguratio
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *QueueApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}

View File

@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
// QueueSpecApplyConfiguration represents an declarative configuration of the QueueSpec type for use
// QueueSpecApplyConfiguration represents a declarative configuration of the QueueSpec type for use
// with apply.
type QueueSpecApplyConfiguration struct {
Weight *int32 `json:"weight,omitempty"`
@ -36,7 +36,7 @@ type QueueSpecApplyConfiguration struct {
Priority *int32 `json:"priority,omitempty"`
}
// QueueSpecApplyConfiguration constructs an declarative configuration of the QueueSpec type for use with
// QueueSpecApplyConfiguration constructs a declarative configuration of the QueueSpec type for use with
// apply.
func QueueSpec() *QueueSpecApplyConfiguration {
return &QueueSpecApplyConfiguration{}

View File

@ -22,7 +22,7 @@ import (
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// QueueStatusApplyConfiguration represents an declarative configuration of the QueueStatus type for use
// QueueStatusApplyConfiguration represents a declarative configuration of the QueueStatus type for use
// with apply.
type QueueStatusApplyConfiguration struct {
State *v1beta1.QueueState `json:"state,omitempty"`
@ -35,7 +35,7 @@ type QueueStatusApplyConfiguration struct {
Allocated *v1.ResourceList `json:"allocated,omitempty"`
}
// QueueStatusApplyConfiguration constructs an declarative configuration of the QueueStatus type for use with
// QueueStatusApplyConfiguration constructs a declarative configuration of the QueueStatus type for use with
// apply.
func QueueStatus() *QueueStatusApplyConfiguration {
return &QueueStatusApplyConfiguration{}

View File

@ -21,14 +21,14 @@ import (
v1 "k8s.io/api/core/v1"
)
// ReservationApplyConfiguration represents an declarative configuration of the Reservation type for use
// ReservationApplyConfiguration represents a declarative configuration of the Reservation type for use
// with apply.
type ReservationApplyConfiguration struct {
Nodes []string `json:"nodes,omitempty"`
Resource *v1.ResourceList `json:"resource,omitempty"`
}
// ReservationApplyConfiguration constructs an declarative configuration of the Reservation type for use with
// ReservationApplyConfiguration constructs a declarative configuration of the Reservation type for use with
// apply.
func Reservation() *ReservationApplyConfiguration {
return &ReservationApplyConfiguration{}

View File

@ -18,7 +18,9 @@ limitations under the License.
package applyconfiguration
import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
testing "k8s.io/client-go/testing"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
@ -27,6 +29,7 @@ import (
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
applyconfigurationbusv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/bus/v1alpha1"
applyconfigurationflowv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/flow/v1alpha1"
internal "volcano.sh/apis/pkg/client/applyconfiguration/internal"
applyconfigurationnodeinfov1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/nodeinfo/v1alpha1"
schedulingv1beta1 "volcano.sh/apis/pkg/client/applyconfiguration/scheduling/v1beta1"
)
@ -134,3 +137,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
}
return nil
}
func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
}

View File

@ -23,6 +23,7 @@ import (
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
applyconfiguration "volcano.sh/apis/pkg/client/applyconfiguration"
clientset "volcano.sh/apis/pkg/client/clientset/versioned"
batchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1"
fakebatchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake"
@ -38,8 +39,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
//
// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
@ -81,6 +86,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
// NewClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewClientset(objects ...runtime.Object) *Clientset {
o := testing.NewFieldManagedObjectTracker(
scheme,
codecs.UniversalDecoder(),
applyconfiguration.NewTypeConverter(scheme),
)
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
cs := &Clientset{tracker: o}
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
cs.AddReactor("*", "*", testing.ObjectReaction(o))
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns)
if err != nil {
return false, nil, err
}
return true, watch, nil
})
return cs
}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}

View File

@ -43,22 +43,24 @@ var jobsKind = v1alpha1.SchemeGroupVersion.WithKind("Job")
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *FakeJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Job, err error) {
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1alpha1.Job{})
Invokes(testing.NewGetActionWithOptions(jobsResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *FakeJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobList, err error) {
emptyResult := &v1alpha1.JobList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &v1alpha1.JobList{})
Invokes(testing.NewListActionWithOptions(jobsResource, jobsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -77,40 +79,43 @@ func (c *FakeJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alp
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(jobsResource, c.ns, opts))
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (result *v1alpha1.Job, err error) {
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1alpha1.Job{})
Invokes(testing.NewCreateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1alpha1.Job{})
Invokes(testing.NewUpdateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), 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 *FakeJobs) UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error) {
func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1alpha1.Job{})
Invokes(testing.NewUpdateSubresourceActionWithOptions(jobsResource, "status", c.ns, job, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}
@ -125,7 +130,7 @@ func (c *FakeJobs) Delete(ctx context.Context, name string, opts v1.DeleteOption
// DeleteCollection deletes a collection of objects.
func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(jobsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.JobList{})
return err
@ -133,11 +138,12 @@ func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions,
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Job, err error) {
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Job{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}
@ -155,11 +161,12 @@ func (c *FakeJobs) Apply(ctx context.Context, job *batchv1alpha1.JobApplyConfigu
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Job{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}
@ -178,11 +185,12 @@ func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1alpha1.JobApplyC
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
emptyResult := &v1alpha1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Job{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Job), err
}

View File

@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -42,6 +39,7 @@ type JobsGetter interface {
type JobInterface interface {
Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (*v1alpha1.Job, error)
Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@ -50,206 +48,25 @@ type JobInterface interface {
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.Job, err error)
Apply(ctx context.Context, job *batchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Job, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, job *batchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Job, err error)
JobExpansion
}
// jobs implements JobInterface
type jobs struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v1alpha1.Job, *v1alpha1.JobList, *batchv1alpha1.JobApplyConfiguration]
}
// newJobs returns a Jobs
func newJobs(c *BatchV1alpha1Client, namespace string) *jobs {
return &jobs{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v1alpha1.Job, *v1alpha1.JobList, *batchv1alpha1.JobApplyConfiguration](
"jobs",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1alpha1.Job { return &v1alpha1.Job{} },
func() *v1alpha1.JobList { return &v1alpha1.JobList{} }),
}
}
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *jobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *jobs) UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result)
return
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched job.
func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobs").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied job.
func (c *jobs) Apply(ctx context.Context, job *batchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(job)
if err != nil {
return nil, err
}
name := job.Name
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
result = &v1alpha1.Job{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobs").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *jobs) ApplyStatus(ctx context.Context, job *batchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(job)
if err != nil {
return nil, err
}
name := job.Name
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
result = &v1alpha1.Job{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobs").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
busv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/bus/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -54,154 +51,18 @@ type CommandInterface interface {
// commands implements CommandInterface
type commands struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v1alpha1.Command, *v1alpha1.CommandList, *busv1alpha1.CommandApplyConfiguration]
}
// newCommands returns a Commands
func newCommands(c *BusV1alpha1Client, namespace string) *commands {
return &commands{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v1alpha1.Command, *v1alpha1.CommandList, *busv1alpha1.CommandApplyConfiguration](
"commands",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1alpha1.Command { return &v1alpha1.Command{} },
func() *v1alpha1.CommandList { return &v1alpha1.CommandList{} }),
}
}
// Get takes name of the command, and returns the corresponding command object, and an error if there is any.
func (c *commands) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Get().
Namespace(c.ns).
Resource("commands").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Commands that match those selectors.
func (c *commands) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CommandList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.CommandList{}
err = c.client.Get().
Namespace(c.ns).
Resource("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested commands.
func (c *commands) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a command and creates it. Returns the server's representation of the command, and an error, if there is any.
func (c *commands) Create(ctx context.Context, command *v1alpha1.Command, opts v1.CreateOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Post().
Namespace(c.ns).
Resource("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Body(command).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a command and updates it. Returns the server's representation of the command, and an error, if there is any.
func (c *commands) Update(ctx context.Context, command *v1alpha1.Command, opts v1.UpdateOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Put().
Namespace(c.ns).
Resource("commands").
Name(command.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(command).
Do(ctx).
Into(result)
return
}
// Delete takes name of the command and deletes it. Returns an error if one occurs.
func (c *commands) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("commands").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *commands) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("commands").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched command.
func (c *commands) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("commands").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied command.
func (c *commands) Apply(ctx context.Context, command *busv1alpha1.CommandApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Command, err error) {
if command == nil {
return nil, fmt.Errorf("command provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(command)
if err != nil {
return nil, err
}
name := command.Name
if name == nil {
return nil, fmt.Errorf("command.Name must be provided to Apply")
}
result = &v1alpha1.Command{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("commands").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -43,22 +43,24 @@ var commandsKind = v1alpha1.SchemeGroupVersion.WithKind("Command")
// Get takes name of the command, and returns the corresponding command object, and an error if there is any.
func (c *FakeCommands) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Command, err error) {
emptyResult := &v1alpha1.Command{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(commandsResource, c.ns, name), &v1alpha1.Command{})
Invokes(testing.NewGetActionWithOptions(commandsResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Command), err
}
// List takes label and field selectors, and returns the list of Commands that match those selectors.
func (c *FakeCommands) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CommandList, err error) {
emptyResult := &v1alpha1.CommandList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(commandsResource, commandsKind, c.ns, opts), &v1alpha1.CommandList{})
Invokes(testing.NewListActionWithOptions(commandsResource, commandsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -77,28 +79,30 @@ func (c *FakeCommands) List(ctx context.Context, opts v1.ListOptions) (result *v
// Watch returns a watch.Interface that watches the requested commands.
func (c *FakeCommands) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(commandsResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(commandsResource, c.ns, opts))
}
// Create takes the representation of a command and creates it. Returns the server's representation of the command, and an error, if there is any.
func (c *FakeCommands) Create(ctx context.Context, command *v1alpha1.Command, opts v1.CreateOptions) (result *v1alpha1.Command, err error) {
emptyResult := &v1alpha1.Command{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(commandsResource, c.ns, command), &v1alpha1.Command{})
Invokes(testing.NewCreateActionWithOptions(commandsResource, c.ns, command, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Command), err
}
// Update takes the representation of a command and updates it. Returns the server's representation of the command, and an error, if there is any.
func (c *FakeCommands) Update(ctx context.Context, command *v1alpha1.Command, opts v1.UpdateOptions) (result *v1alpha1.Command, err error) {
emptyResult := &v1alpha1.Command{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(commandsResource, c.ns, command), &v1alpha1.Command{})
Invokes(testing.NewUpdateActionWithOptions(commandsResource, c.ns, command, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Command), err
}
@ -113,7 +117,7 @@ func (c *FakeCommands) Delete(ctx context.Context, name string, opts v1.DeleteOp
// DeleteCollection deletes a collection of objects.
func (c *FakeCommands) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(commandsResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(commandsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.CommandList{})
return err
@ -121,11 +125,12 @@ func (c *FakeCommands) DeleteCollection(ctx context.Context, opts v1.DeleteOptio
// Patch applies the patch and returns the patched command.
func (c *FakeCommands) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Command, err error) {
emptyResult := &v1alpha1.Command{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(commandsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Command{})
Invokes(testing.NewPatchSubresourceActionWithOptions(commandsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Command), err
}
@ -143,11 +148,12 @@ func (c *FakeCommands) Apply(ctx context.Context, command *busv1alpha1.CommandAp
if name == nil {
return nil, fmt.Errorf("command.Name must be provided to Apply")
}
emptyResult := &v1alpha1.Command{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(commandsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Command{})
Invokes(testing.NewPatchSubresourceActionWithOptions(commandsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Command), err
}

View File

@ -43,22 +43,24 @@ var jobflowsKind = v1alpha1.SchemeGroupVersion.WithKind("JobFlow")
// Get takes name of the jobFlow, and returns the corresponding jobFlow object, and an error if there is any.
func (c *FakeJobFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobFlow, err error) {
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobflowsResource, c.ns, name), &v1alpha1.JobFlow{})
Invokes(testing.NewGetActionWithOptions(jobflowsResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}
// List takes label and field selectors, and returns the list of JobFlows that match those selectors.
func (c *FakeJobFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobFlowList, err error) {
emptyResult := &v1alpha1.JobFlowList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(jobflowsResource, jobflowsKind, c.ns, opts), &v1alpha1.JobFlowList{})
Invokes(testing.NewListActionWithOptions(jobflowsResource, jobflowsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -77,40 +79,43 @@ func (c *FakeJobFlows) List(ctx context.Context, opts v1.ListOptions) (result *v
// Watch returns a watch.Interface that watches the requested jobFlows.
func (c *FakeJobFlows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobflowsResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(jobflowsResource, c.ns, opts))
}
// Create takes the representation of a jobFlow and creates it. Returns the server's representation of the jobFlow, and an error, if there is any.
func (c *FakeJobFlows) Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (result *v1alpha1.JobFlow, err error) {
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobflowsResource, c.ns, jobFlow), &v1alpha1.JobFlow{})
Invokes(testing.NewCreateActionWithOptions(jobflowsResource, c.ns, jobFlow, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}
// Update takes the representation of a jobFlow and updates it. Returns the server's representation of the jobFlow, and an error, if there is any.
func (c *FakeJobFlows) Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) {
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobflowsResource, c.ns, jobFlow), &v1alpha1.JobFlow{})
Invokes(testing.NewUpdateActionWithOptions(jobflowsResource, c.ns, jobFlow, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), 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 *FakeJobFlows) UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, error) {
func (c *FakeJobFlows) UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) {
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobflowsResource, "status", c.ns, jobFlow), &v1alpha1.JobFlow{})
Invokes(testing.NewUpdateSubresourceActionWithOptions(jobflowsResource, "status", c.ns, jobFlow, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}
@ -125,7 +130,7 @@ func (c *FakeJobFlows) Delete(ctx context.Context, name string, opts v1.DeleteOp
// DeleteCollection deletes a collection of objects.
func (c *FakeJobFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobflowsResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(jobflowsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.JobFlowList{})
return err
@ -133,11 +138,12 @@ func (c *FakeJobFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptio
// Patch applies the patch and returns the patched jobFlow.
func (c *FakeJobFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobFlow, err error) {
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobflowsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobFlow{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobflowsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}
@ -155,11 +161,12 @@ func (c *FakeJobFlows) Apply(ctx context.Context, jobFlow *flowv1alpha1.JobFlowA
if name == nil {
return nil, fmt.Errorf("jobFlow.Name must be provided to Apply")
}
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobflowsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.JobFlow{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobflowsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}
@ -178,11 +185,12 @@ func (c *FakeJobFlows) ApplyStatus(ctx context.Context, jobFlow *flowv1alpha1.Jo
if name == nil {
return nil, fmt.Errorf("jobFlow.Name must be provided to Apply")
}
emptyResult := &v1alpha1.JobFlow{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobflowsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.JobFlow{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobflowsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobFlow), err
}

View File

@ -43,22 +43,24 @@ var jobtemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("JobTemplate")
// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any.
func (c *FakeJobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) {
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobtemplatesResource, c.ns, name), &v1alpha1.JobTemplate{})
Invokes(testing.NewGetActionWithOptions(jobtemplatesResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
// List takes label and field selectors, and returns the list of JobTemplates that match those selectors.
func (c *FakeJobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) {
emptyResult := &v1alpha1.JobTemplateList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(jobtemplatesResource, jobtemplatesKind, c.ns, opts), &v1alpha1.JobTemplateList{})
Invokes(testing.NewListActionWithOptions(jobtemplatesResource, jobtemplatesKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -77,40 +79,43 @@ func (c *FakeJobTemplates) List(ctx context.Context, opts v1.ListOptions) (resul
// Watch returns a watch.Interface that watches the requested jobTemplates.
func (c *FakeJobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobtemplatesResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(jobtemplatesResource, c.ns, opts))
}
// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *FakeJobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) {
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{})
Invokes(testing.NewCreateActionWithOptions(jobtemplatesResource, c.ns, jobTemplate, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *FakeJobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{})
Invokes(testing.NewUpdateActionWithOptions(jobtemplatesResource, c.ns, jobTemplate, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), 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 *FakeJobTemplates) UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, error) {
func (c *FakeJobTemplates) UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobtemplatesResource, "status", c.ns, jobTemplate), &v1alpha1.JobTemplate{})
Invokes(testing.NewUpdateSubresourceActionWithOptions(jobtemplatesResource, "status", c.ns, jobTemplate, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
@ -125,7 +130,7 @@ func (c *FakeJobTemplates) Delete(ctx context.Context, name string, opts v1.Dele
// DeleteCollection deletes a collection of objects.
func (c *FakeJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobtemplatesResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(jobtemplatesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.JobTemplateList{})
return err
@ -133,11 +138,12 @@ func (c *FakeJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteO
// Patch applies the patch and returns the patched jobTemplate.
func (c *FakeJobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) {
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobtemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobTemplate{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
@ -155,11 +161,12 @@ func (c *FakeJobTemplates) Apply(ctx context.Context, jobTemplate *flowv1alpha1.
if name == nil {
return nil, fmt.Errorf("jobTemplate.Name must be provided to Apply")
}
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobtemplatesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.JobTemplate{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
@ -178,11 +185,12 @@ func (c *FakeJobTemplates) ApplyStatus(ctx context.Context, jobTemplate *flowv1a
if name == nil {
return nil, fmt.Errorf("jobTemplate.Name must be provided to Apply")
}
emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobtemplatesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.JobTemplate{})
Invokes(testing.NewPatchSubresourceActionWithOptions(jobtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}

View File

@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
flowv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/flow/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -42,6 +39,7 @@ type JobFlowsGetter interface {
type JobFlowInterface interface {
Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (*v1alpha1.JobFlow, error)
Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@ -50,206 +48,25 @@ type JobFlowInterface interface {
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.JobFlow, err error)
Apply(ctx context.Context, jobFlow *flowv1alpha1.JobFlowApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobFlow, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, jobFlow *flowv1alpha1.JobFlowApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobFlow, err error)
JobFlowExpansion
}
// jobFlows implements JobFlowInterface
type jobFlows struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v1alpha1.JobFlow, *v1alpha1.JobFlowList, *flowv1alpha1.JobFlowApplyConfiguration]
}
// newJobFlows returns a JobFlows
func newJobFlows(c *FlowV1alpha1Client, namespace string) *jobFlows {
return &jobFlows{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v1alpha1.JobFlow, *v1alpha1.JobFlowList, *flowv1alpha1.JobFlowApplyConfiguration](
"jobflows",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1alpha1.JobFlow { return &v1alpha1.JobFlow{} },
func() *v1alpha1.JobFlowList { return &v1alpha1.JobFlowList{} }),
}
}
// Get takes name of the jobFlow, and returns the corresponding jobFlow object, and an error if there is any.
func (c *jobFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobFlow, err error) {
result = &v1alpha1.JobFlow{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobflows").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of JobFlows that match those selectors.
func (c *jobFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobFlowList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.JobFlowList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobflows").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobFlows.
func (c *jobFlows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("jobflows").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a jobFlow and creates it. Returns the server's representation of the jobFlow, and an error, if there is any.
func (c *jobFlows) Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (result *v1alpha1.JobFlow, err error) {
result = &v1alpha1.JobFlow{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobflows").
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobFlow).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a jobFlow and updates it. Returns the server's representation of the jobFlow, and an error, if there is any.
func (c *jobFlows) Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) {
result = &v1alpha1.JobFlow{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobflows").
Name(jobFlow.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobFlow).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *jobFlows) UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) {
result = &v1alpha1.JobFlow{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobflows").
Name(jobFlow.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobFlow).
Do(ctx).
Into(result)
return
}
// Delete takes name of the jobFlow and deletes it. Returns an error if one occurs.
func (c *jobFlows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobflows").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("jobflows").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched jobFlow.
func (c *jobFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobFlow, err error) {
result = &v1alpha1.JobFlow{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobflows").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied jobFlow.
func (c *jobFlows) Apply(ctx context.Context, jobFlow *flowv1alpha1.JobFlowApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobFlow, err error) {
if jobFlow == nil {
return nil, fmt.Errorf("jobFlow provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(jobFlow)
if err != nil {
return nil, err
}
name := jobFlow.Name
if name == nil {
return nil, fmt.Errorf("jobFlow.Name must be provided to Apply")
}
result = &v1alpha1.JobFlow{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobflows").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *jobFlows) ApplyStatus(ctx context.Context, jobFlow *flowv1alpha1.JobFlowApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobFlow, err error) {
if jobFlow == nil {
return nil, fmt.Errorf("jobFlow provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(jobFlow)
if err != nil {
return nil, err
}
name := jobFlow.Name
if name == nil {
return nil, fmt.Errorf("jobFlow.Name must be provided to Apply")
}
result = &v1alpha1.JobFlow{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobflows").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
flowv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/flow/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -42,6 +39,7 @@ type JobTemplatesGetter interface {
type JobTemplateInterface interface {
Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (*v1alpha1.JobTemplate, error)
Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@ -50,206 +48,25 @@ type JobTemplateInterface interface {
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.JobTemplate, err error)
Apply(ctx context.Context, jobTemplate *flowv1alpha1.JobTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobTemplate, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, jobTemplate *flowv1alpha1.JobTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobTemplate, err error)
JobTemplateExpansion
}
// jobTemplates implements JobTemplateInterface
type jobTemplates struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v1alpha1.JobTemplate, *v1alpha1.JobTemplateList, *flowv1alpha1.JobTemplateApplyConfiguration]
}
// newJobTemplates returns a JobTemplates
func newJobTemplates(c *FlowV1alpha1Client, namespace string) *jobTemplates {
return &jobTemplates{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v1alpha1.JobTemplate, *v1alpha1.JobTemplateList, *flowv1alpha1.JobTemplateApplyConfiguration](
"jobtemplates",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1alpha1.JobTemplate { return &v1alpha1.JobTemplate{} },
func() *v1alpha1.JobTemplateList { return &v1alpha1.JobTemplateList{} }),
}
}
// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any.
func (c *jobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) {
result = &v1alpha1.JobTemplate{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobtemplates").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of JobTemplates that match those selectors.
func (c *jobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.JobTemplateList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobTemplates.
func (c *jobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("jobtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *jobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) {
result = &v1alpha1.JobTemplate{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobTemplate).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *jobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
result = &v1alpha1.JobTemplate{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobtemplates").
Name(jobTemplate.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobTemplate).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *jobTemplates) UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
result = &v1alpha1.JobTemplate{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobtemplates").
Name(jobTemplate.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(jobTemplate).
Do(ctx).
Into(result)
return
}
// Delete takes name of the jobTemplate and deletes it. Returns an error if one occurs.
func (c *jobTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobtemplates").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("jobtemplates").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched jobTemplate.
func (c *jobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) {
result = &v1alpha1.JobTemplate{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobtemplates").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied jobTemplate.
func (c *jobTemplates) Apply(ctx context.Context, jobTemplate *flowv1alpha1.JobTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobTemplate, err error) {
if jobTemplate == nil {
return nil, fmt.Errorf("jobTemplate provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(jobTemplate)
if err != nil {
return nil, err
}
name := jobTemplate.Name
if name == nil {
return nil, fmt.Errorf("jobTemplate.Name must be provided to Apply")
}
result = &v1alpha1.JobTemplate{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobtemplates").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *jobTemplates) ApplyStatus(ctx context.Context, jobTemplate *flowv1alpha1.JobTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.JobTemplate, err error) {
if jobTemplate == nil {
return nil, fmt.Errorf("jobTemplate provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(jobTemplate)
if err != nil {
return nil, err
}
name := jobTemplate.Name
if name == nil {
return nil, fmt.Errorf("jobTemplate.Name must be provided to Apply")
}
result = &v1alpha1.JobTemplate{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobtemplates").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -42,20 +42,22 @@ var numatopologiesKind = v1alpha1.SchemeGroupVersion.WithKind("Numatopology")
// Get takes name of the numatopology, and returns the corresponding numatopology object, and an error if there is any.
func (c *FakeNumatopologies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Numatopology, err error) {
emptyResult := &v1alpha1.Numatopology{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(numatopologiesResource, name), &v1alpha1.Numatopology{})
Invokes(testing.NewRootGetActionWithOptions(numatopologiesResource, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Numatopology), err
}
// List takes label and field selectors, and returns the list of Numatopologies that match those selectors.
func (c *FakeNumatopologies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NumatopologyList, err error) {
emptyResult := &v1alpha1.NumatopologyList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(numatopologiesResource, numatopologiesKind, opts), &v1alpha1.NumatopologyList{})
Invokes(testing.NewRootListActionWithOptions(numatopologiesResource, numatopologiesKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -74,25 +76,27 @@ func (c *FakeNumatopologies) List(ctx context.Context, opts v1.ListOptions) (res
// Watch returns a watch.Interface that watches the requested numatopologies.
func (c *FakeNumatopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(numatopologiesResource, opts))
InvokesWatch(testing.NewRootWatchActionWithOptions(numatopologiesResource, opts))
}
// Create takes the representation of a numatopology and creates it. Returns the server's representation of the numatopology, and an error, if there is any.
func (c *FakeNumatopologies) Create(ctx context.Context, numatopology *v1alpha1.Numatopology, opts v1.CreateOptions) (result *v1alpha1.Numatopology, err error) {
emptyResult := &v1alpha1.Numatopology{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(numatopologiesResource, numatopology), &v1alpha1.Numatopology{})
Invokes(testing.NewRootCreateActionWithOptions(numatopologiesResource, numatopology, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Numatopology), err
}
// Update takes the representation of a numatopology and updates it. Returns the server's representation of the numatopology, and an error, if there is any.
func (c *FakeNumatopologies) Update(ctx context.Context, numatopology *v1alpha1.Numatopology, opts v1.UpdateOptions) (result *v1alpha1.Numatopology, err error) {
emptyResult := &v1alpha1.Numatopology{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(numatopologiesResource, numatopology), &v1alpha1.Numatopology{})
Invokes(testing.NewRootUpdateActionWithOptions(numatopologiesResource, numatopology, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Numatopology), err
}
@ -106,7 +110,7 @@ func (c *FakeNumatopologies) Delete(ctx context.Context, name string, opts v1.De
// DeleteCollection deletes a collection of objects.
func (c *FakeNumatopologies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(numatopologiesResource, listOpts)
action := testing.NewRootDeleteCollectionActionWithOptions(numatopologiesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.NumatopologyList{})
return err
@ -114,10 +118,11 @@ func (c *FakeNumatopologies) DeleteCollection(ctx context.Context, opts v1.Delet
// Patch applies the patch and returns the patched numatopology.
func (c *FakeNumatopologies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Numatopology, err error) {
emptyResult := &v1alpha1.Numatopology{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(numatopologiesResource, name, pt, data, subresources...), &v1alpha1.Numatopology{})
Invokes(testing.NewRootPatchSubresourceActionWithOptions(numatopologiesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Numatopology), err
}
@ -135,10 +140,11 @@ func (c *FakeNumatopologies) Apply(ctx context.Context, numatopology *nodeinfov1
if name == nil {
return nil, fmt.Errorf("numatopology.Name must be provided to Apply")
}
emptyResult := &v1alpha1.Numatopology{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(numatopologiesResource, *name, types.ApplyPatchType, data), &v1alpha1.Numatopology{})
Invokes(testing.NewRootPatchSubresourceActionWithOptions(numatopologiesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.Numatopology), err
}

View File

@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
nodeinfov1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/nodeinfo/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -54,143 +51,18 @@ type NumatopologyInterface interface {
// numatopologies implements NumatopologyInterface
type numatopologies struct {
client rest.Interface
*gentype.ClientWithListAndApply[*v1alpha1.Numatopology, *v1alpha1.NumatopologyList, *nodeinfov1alpha1.NumatopologyApplyConfiguration]
}
// newNumatopologies returns a Numatopologies
func newNumatopologies(c *NodeinfoV1alpha1Client) *numatopologies {
return &numatopologies{
client: c.RESTClient(),
gentype.NewClientWithListAndApply[*v1alpha1.Numatopology, *v1alpha1.NumatopologyList, *nodeinfov1alpha1.NumatopologyApplyConfiguration](
"numatopologies",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *v1alpha1.Numatopology { return &v1alpha1.Numatopology{} },
func() *v1alpha1.NumatopologyList { return &v1alpha1.NumatopologyList{} }),
}
}
// Get takes name of the numatopology, and returns the corresponding numatopology object, and an error if there is any.
func (c *numatopologies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Numatopology, err error) {
result = &v1alpha1.Numatopology{}
err = c.client.Get().
Resource("numatopologies").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Numatopologies that match those selectors.
func (c *numatopologies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NumatopologyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.NumatopologyList{}
err = c.client.Get().
Resource("numatopologies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested numatopologies.
func (c *numatopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("numatopologies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a numatopology and creates it. Returns the server's representation of the numatopology, and an error, if there is any.
func (c *numatopologies) Create(ctx context.Context, numatopology *v1alpha1.Numatopology, opts v1.CreateOptions) (result *v1alpha1.Numatopology, err error) {
result = &v1alpha1.Numatopology{}
err = c.client.Post().
Resource("numatopologies").
VersionedParams(&opts, scheme.ParameterCodec).
Body(numatopology).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a numatopology and updates it. Returns the server's representation of the numatopology, and an error, if there is any.
func (c *numatopologies) Update(ctx context.Context, numatopology *v1alpha1.Numatopology, opts v1.UpdateOptions) (result *v1alpha1.Numatopology, err error) {
result = &v1alpha1.Numatopology{}
err = c.client.Put().
Resource("numatopologies").
Name(numatopology.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(numatopology).
Do(ctx).
Into(result)
return
}
// Delete takes name of the numatopology and deletes it. Returns an error if one occurs.
func (c *numatopologies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("numatopologies").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *numatopologies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("numatopologies").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched numatopology.
func (c *numatopologies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Numatopology, err error) {
result = &v1alpha1.Numatopology{}
err = c.client.Patch(pt).
Resource("numatopologies").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied numatopology.
func (c *numatopologies) Apply(ctx context.Context, numatopology *nodeinfov1alpha1.NumatopologyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Numatopology, err error) {
if numatopology == nil {
return nil, fmt.Errorf("numatopology provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(numatopology)
if err != nil {
return nil, err
}
name := numatopology.Name
if name == nil {
return nil, fmt.Errorf("numatopology.Name must be provided to Apply")
}
result = &v1alpha1.Numatopology{}
err = c.client.Patch(types.ApplyPatchType).
Resource("numatopologies").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -43,22 +43,24 @@ var podgroupsKind = v1beta1.SchemeGroupVersion.WithKind("PodGroup")
// Get takes name of the podGroup, and returns the corresponding podGroup object, and an error if there is any.
func (c *FakePodGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodGroup, err error) {
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(podgroupsResource, c.ns, name), &v1beta1.PodGroup{})
Invokes(testing.NewGetActionWithOptions(podgroupsResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}
// List takes label and field selectors, and returns the list of PodGroups that match those selectors.
func (c *FakePodGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodGroupList, err error) {
emptyResult := &v1beta1.PodGroupList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(podgroupsResource, podgroupsKind, c.ns, opts), &v1beta1.PodGroupList{})
Invokes(testing.NewListActionWithOptions(podgroupsResource, podgroupsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -77,40 +79,43 @@ func (c *FakePodGroups) List(ctx context.Context, opts v1.ListOptions) (result *
// Watch returns a watch.Interface that watches the requested podGroups.
func (c *FakePodGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podgroupsResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(podgroupsResource, c.ns, opts))
}
// Create takes the representation of a podGroup and creates it. Returns the server's representation of the podGroup, and an error, if there is any.
func (c *FakePodGroups) Create(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.CreateOptions) (result *v1beta1.PodGroup, err error) {
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podgroupsResource, c.ns, podGroup), &v1beta1.PodGroup{})
Invokes(testing.NewCreateActionWithOptions(podgroupsResource, c.ns, podGroup, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}
// Update takes the representation of a podGroup and updates it. Returns the server's representation of the podGroup, and an error, if there is any.
func (c *FakePodGroups) Update(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (result *v1beta1.PodGroup, err error) {
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podgroupsResource, c.ns, podGroup), &v1beta1.PodGroup{})
Invokes(testing.NewUpdateActionWithOptions(podgroupsResource, c.ns, podGroup, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), 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 *FakePodGroups) UpdateStatus(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (*v1beta1.PodGroup, error) {
func (c *FakePodGroups) UpdateStatus(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (result *v1beta1.PodGroup, err error) {
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podgroupsResource, "status", c.ns, podGroup), &v1beta1.PodGroup{})
Invokes(testing.NewUpdateSubresourceActionWithOptions(podgroupsResource, "status", c.ns, podGroup, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}
@ -125,7 +130,7 @@ func (c *FakePodGroups) Delete(ctx context.Context, name string, opts v1.DeleteO
// DeleteCollection deletes a collection of objects.
func (c *FakePodGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podgroupsResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(podgroupsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.PodGroupList{})
return err
@ -133,11 +138,12 @@ func (c *FakePodGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOpti
// Patch applies the patch and returns the patched podGroup.
func (c *FakePodGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodGroup, err error) {
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podgroupsResource, c.ns, name, pt, data, subresources...), &v1beta1.PodGroup{})
Invokes(testing.NewPatchSubresourceActionWithOptions(podgroupsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}
@ -155,11 +161,12 @@ func (c *FakePodGroups) Apply(ctx context.Context, podGroup *schedulingv1beta1.P
if name == nil {
return nil, fmt.Errorf("podGroup.Name must be provided to Apply")
}
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podgroupsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.PodGroup{})
Invokes(testing.NewPatchSubresourceActionWithOptions(podgroupsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}
@ -178,11 +185,12 @@ func (c *FakePodGroups) ApplyStatus(ctx context.Context, podGroup *schedulingv1b
if name == nil {
return nil, fmt.Errorf("podGroup.Name must be provided to Apply")
}
emptyResult := &v1beta1.PodGroup{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podgroupsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.PodGroup{})
Invokes(testing.NewPatchSubresourceActionWithOptions(podgroupsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.PodGroup), err
}

View File

@ -42,20 +42,22 @@ var queuesKind = v1beta1.SchemeGroupVersion.WithKind("Queue")
// Get takes name of the queue, and returns the corresponding queue object, and an error if there is any.
func (c *FakeQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Queue, err error) {
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(queuesResource, name), &v1beta1.Queue{})
Invokes(testing.NewRootGetActionWithOptions(queuesResource, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}
// List takes label and field selectors, and returns the list of Queues that match those selectors.
func (c *FakeQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.QueueList, err error) {
emptyResult := &v1beta1.QueueList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(queuesResource, queuesKind, opts), &v1beta1.QueueList{})
Invokes(testing.NewRootListActionWithOptions(queuesResource, queuesKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@ -74,36 +76,39 @@ func (c *FakeQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1b
// Watch returns a watch.Interface that watches the requested queues.
func (c *FakeQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(queuesResource, opts))
InvokesWatch(testing.NewRootWatchActionWithOptions(queuesResource, opts))
}
// Create takes the representation of a queue and creates it. Returns the server's representation of the queue, and an error, if there is any.
func (c *FakeQueues) Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (result *v1beta1.Queue, err error) {
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(queuesResource, queue), &v1beta1.Queue{})
Invokes(testing.NewRootCreateActionWithOptions(queuesResource, queue, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}
// Update takes the representation of a queue and updates it. Returns the server's representation of the queue, and an error, if there is any.
func (c *FakeQueues) Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) {
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(queuesResource, queue), &v1beta1.Queue{})
Invokes(testing.NewRootUpdateActionWithOptions(queuesResource, queue, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), 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 *FakeQueues) UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error) {
func (c *FakeQueues) UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) {
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(queuesResource, "status", queue), &v1beta1.Queue{})
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(queuesResource, "status", queue, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}
@ -117,7 +122,7 @@ func (c *FakeQueues) Delete(ctx context.Context, name string, opts v1.DeleteOpti
// DeleteCollection deletes a collection of objects.
func (c *FakeQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(queuesResource, listOpts)
action := testing.NewRootDeleteCollectionActionWithOptions(queuesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.QueueList{})
return err
@ -125,10 +130,11 @@ func (c *FakeQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions
// Patch applies the patch and returns the patched queue.
func (c *FakeQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Queue, err error) {
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(queuesResource, name, pt, data, subresources...), &v1beta1.Queue{})
Invokes(testing.NewRootPatchSubresourceActionWithOptions(queuesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}
@ -146,10 +152,11 @@ func (c *FakeQueues) Apply(ctx context.Context, queue *schedulingv1beta1.QueueAp
if name == nil {
return nil, fmt.Errorf("queue.Name must be provided to Apply")
}
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(queuesResource, *name, types.ApplyPatchType, data), &v1beta1.Queue{})
Invokes(testing.NewRootPatchSubresourceActionWithOptions(queuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}
@ -168,10 +175,11 @@ func (c *FakeQueues) ApplyStatus(ctx context.Context, queue *schedulingv1beta1.Q
if name == nil {
return nil, fmt.Errorf("queue.Name must be provided to Apply")
}
emptyResult := &v1beta1.Queue{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(queuesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.Queue{})
Invokes(testing.NewRootPatchSubresourceActionWithOptions(queuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Queue), err
}

View File

@ -19,14 +19,11 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
schedulingv1beta1 "volcano.sh/apis/pkg/client/applyconfiguration/scheduling/v1beta1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -42,6 +39,7 @@ type PodGroupsGetter interface {
type PodGroupInterface interface {
Create(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.CreateOptions) (*v1beta1.PodGroup, error)
Update(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (*v1beta1.PodGroup, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (*v1beta1.PodGroup, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@ -50,206 +48,25 @@ type PodGroupInterface interface {
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 *v1beta1.PodGroup, err error)
Apply(ctx context.Context, podGroup *schedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodGroup, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, podGroup *schedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodGroup, err error)
PodGroupExpansion
}
// podGroups implements PodGroupInterface
type podGroups struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v1beta1.PodGroup, *v1beta1.PodGroupList, *schedulingv1beta1.PodGroupApplyConfiguration]
}
// newPodGroups returns a PodGroups
func newPodGroups(c *SchedulingV1beta1Client, namespace string) *podGroups {
return &podGroups{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v1beta1.PodGroup, *v1beta1.PodGroupList, *schedulingv1beta1.PodGroupApplyConfiguration](
"podgroups",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v1beta1.PodGroup { return &v1beta1.PodGroup{} },
func() *v1beta1.PodGroupList { return &v1beta1.PodGroupList{} }),
}
}
// Get takes name of the podGroup, and returns the corresponding podGroup object, and an error if there is any.
func (c *podGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodGroup, err error) {
result = &v1beta1.PodGroup{}
err = c.client.Get().
Namespace(c.ns).
Resource("podgroups").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of PodGroups that match those selectors.
func (c *podGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodGroupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PodGroupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podgroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podGroups.
func (c *podGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("podgroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a podGroup and creates it. Returns the server's representation of the podGroup, and an error, if there is any.
func (c *podGroups) Create(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.CreateOptions) (result *v1beta1.PodGroup, err error) {
result = &v1beta1.PodGroup{}
err = c.client.Post().
Namespace(c.ns).
Resource("podgroups").
VersionedParams(&opts, scheme.ParameterCodec).
Body(podGroup).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a podGroup and updates it. Returns the server's representation of the podGroup, and an error, if there is any.
func (c *podGroups) Update(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (result *v1beta1.PodGroup, err error) {
result = &v1beta1.PodGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("podgroups").
Name(podGroup.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(podGroup).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *podGroups) UpdateStatus(ctx context.Context, podGroup *v1beta1.PodGroup, opts v1.UpdateOptions) (result *v1beta1.PodGroup, err error) {
result = &v1beta1.PodGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("podgroups").
Name(podGroup.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(podGroup).
Do(ctx).
Into(result)
return
}
// Delete takes name of the podGroup and deletes it. Returns an error if one occurs.
func (c *podGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podgroups").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *podGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("podgroups").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched podGroup.
func (c *podGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodGroup, err error) {
result = &v1beta1.PodGroup{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("podgroups").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podGroup.
func (c *podGroups) Apply(ctx context.Context, podGroup *schedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodGroup, err error) {
if podGroup == nil {
return nil, fmt.Errorf("podGroup provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podGroup)
if err != nil {
return nil, err
}
name := podGroup.Name
if name == nil {
return nil, fmt.Errorf("podGroup.Name must be provided to Apply")
}
result = &v1beta1.PodGroup{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("podgroups").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *podGroups) ApplyStatus(ctx context.Context, podGroup *schedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodGroup, err error) {
if podGroup == nil {
return nil, fmt.Errorf("podGroup provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podGroup)
if err != nil {
return nil, err
}
name := podGroup.Name
if name == nil {
return nil, fmt.Errorf("podGroup.Name must be provided to Apply")
}
result = &v1beta1.PodGroup{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("podgroups").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -19,14 +19,11 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
schedulingv1beta1 "volcano.sh/apis/pkg/client/applyconfiguration/scheduling/v1beta1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
@ -42,6 +39,7 @@ type QueuesGetter interface {
type QueueInterface interface {
Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (*v1beta1.Queue, error)
Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (*v1beta1.Queue, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@ -50,193 +48,25 @@ type QueueInterface interface {
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 *v1beta1.Queue, err error)
Apply(ctx context.Context, queue *schedulingv1beta1.QueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Queue, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, queue *schedulingv1beta1.QueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Queue, err error)
QueueExpansion
}
// queues implements QueueInterface
type queues struct {
client rest.Interface
*gentype.ClientWithListAndApply[*v1beta1.Queue, *v1beta1.QueueList, *schedulingv1beta1.QueueApplyConfiguration]
}
// newQueues returns a Queues
func newQueues(c *SchedulingV1beta1Client) *queues {
return &queues{
client: c.RESTClient(),
gentype.NewClientWithListAndApply[*v1beta1.Queue, *v1beta1.QueueList, *schedulingv1beta1.QueueApplyConfiguration](
"queues",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *v1beta1.Queue { return &v1beta1.Queue{} },
func() *v1beta1.QueueList { return &v1beta1.QueueList{} }),
}
}
// Get takes name of the queue, and returns the corresponding queue object, and an error if there is any.
func (c *queues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Queue, err error) {
result = &v1beta1.Queue{}
err = c.client.Get().
Resource("queues").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Queues that match those selectors.
func (c *queues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.QueueList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.QueueList{}
err = c.client.Get().
Resource("queues").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested queues.
func (c *queues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("queues").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a queue and creates it. Returns the server's representation of the queue, and an error, if there is any.
func (c *queues) Create(ctx context.Context, queue *v1beta1.Queue, opts v1.CreateOptions) (result *v1beta1.Queue, err error) {
result = &v1beta1.Queue{}
err = c.client.Post().
Resource("queues").
VersionedParams(&opts, scheme.ParameterCodec).
Body(queue).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a queue and updates it. Returns the server's representation of the queue, and an error, if there is any.
func (c *queues) Update(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) {
result = &v1beta1.Queue{}
err = c.client.Put().
Resource("queues").
Name(queue.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(queue).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *queues) UpdateStatus(ctx context.Context, queue *v1beta1.Queue, opts v1.UpdateOptions) (result *v1beta1.Queue, err error) {
result = &v1beta1.Queue{}
err = c.client.Put().
Resource("queues").
Name(queue.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(queue).
Do(ctx).
Into(result)
return
}
// Delete takes name of the queue and deletes it. Returns an error if one occurs.
func (c *queues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("queues").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *queues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("queues").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched queue.
func (c *queues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Queue, err error) {
result = &v1beta1.Queue{}
err = c.client.Patch(pt).
Resource("queues").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied queue.
func (c *queues) Apply(ctx context.Context, queue *schedulingv1beta1.QueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Queue, err error) {
if queue == nil {
return nil, fmt.Errorf("queue provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(queue)
if err != nil {
return nil, err
}
name := queue.Name
if name == nil {
return nil, fmt.Errorf("queue.Name must be provided to Apply")
}
result = &v1beta1.Queue{}
err = c.client.Patch(types.ApplyPatchType).
Resource("queues").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *queues) ApplyStatus(ctx context.Context, queue *schedulingv1beta1.QueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Queue, err error) {
if queue == nil {
return nil, fmt.Errorf("queue provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(queue)
if err != nil {
return nil, err
}
name := queue.Name
if name == nil {
return nil, fmt.Errorf("queue.Name must be provided to Apply")
}
result = &v1beta1.Queue{}
err = c.client.Patch(types.ApplyPatchType).
Resource("queues").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -231,6 +231,7 @@ type SharedInformerFactory interface {
// Start initializes all requested informers. They are handled in goroutines
// which run until the stop channel gets closed.
// Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
Start(stopCh <-chan struct{})
// Shutdown marks a factory as shutting down. At that point no new

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
@ -37,25 +37,17 @@ type JobLister interface {
// jobLister implements the JobLister interface.
type jobLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1alpha1.Job]
}
// NewJobLister returns a new JobLister.
func NewJobLister(indexer cache.Indexer) JobLister {
return &jobLister{indexer: indexer}
}
// List lists all Jobs in the indexer.
func (s *jobLister) List(selector labels.Selector) (ret []*v1alpha1.Job, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Job))
})
return ret, err
return &jobLister{listers.New[*v1alpha1.Job](indexer, v1alpha1.Resource("job"))}
}
// Jobs returns an object that can list and get Jobs.
func (s *jobLister) Jobs(namespace string) JobNamespaceLister {
return jobNamespaceLister{indexer: s.indexer, namespace: namespace}
return jobNamespaceLister{listers.NewNamespaced[*v1alpha1.Job](s.ResourceIndexer, namespace)}
}
// JobNamespaceLister helps list and get Jobs.
@ -73,26 +65,5 @@ type JobNamespaceLister interface {
// jobNamespaceLister implements the JobNamespaceLister
// interface.
type jobNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Jobs in the indexer for a given namespace.
func (s jobNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Job, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Job))
})
return ret, err
}
// Get retrieves the Job from the indexer for a given namespace and name.
func (s jobNamespaceLister) Get(name string) (*v1alpha1.Job, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("job"), name)
}
return obj.(*v1alpha1.Job), nil
listers.ResourceIndexer[*v1alpha1.Job]
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
)
@ -37,25 +37,17 @@ type CommandLister interface {
// commandLister implements the CommandLister interface.
type commandLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1alpha1.Command]
}
// NewCommandLister returns a new CommandLister.
func NewCommandLister(indexer cache.Indexer) CommandLister {
return &commandLister{indexer: indexer}
}
// List lists all Commands in the indexer.
func (s *commandLister) List(selector labels.Selector) (ret []*v1alpha1.Command, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Command))
})
return ret, err
return &commandLister{listers.New[*v1alpha1.Command](indexer, v1alpha1.Resource("command"))}
}
// Commands returns an object that can list and get Commands.
func (s *commandLister) Commands(namespace string) CommandNamespaceLister {
return commandNamespaceLister{indexer: s.indexer, namespace: namespace}
return commandNamespaceLister{listers.NewNamespaced[*v1alpha1.Command](s.ResourceIndexer, namespace)}
}
// CommandNamespaceLister helps list and get Commands.
@ -73,26 +65,5 @@ type CommandNamespaceLister interface {
// commandNamespaceLister implements the CommandNamespaceLister
// interface.
type commandNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Commands in the indexer for a given namespace.
func (s commandNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Command, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Command))
})
return ret, err
}
// Get retrieves the Command from the indexer for a given namespace and name.
func (s commandNamespaceLister) Get(name string) (*v1alpha1.Command, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("command"), name)
}
return obj.(*v1alpha1.Command), nil
listers.ResourceIndexer[*v1alpha1.Command]
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
@ -37,25 +37,17 @@ type JobFlowLister interface {
// jobFlowLister implements the JobFlowLister interface.
type jobFlowLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1alpha1.JobFlow]
}
// NewJobFlowLister returns a new JobFlowLister.
func NewJobFlowLister(indexer cache.Indexer) JobFlowLister {
return &jobFlowLister{indexer: indexer}
}
// List lists all JobFlows in the indexer.
func (s *jobFlowLister) List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.JobFlow))
})
return ret, err
return &jobFlowLister{listers.New[*v1alpha1.JobFlow](indexer, v1alpha1.Resource("jobflow"))}
}
// JobFlows returns an object that can list and get JobFlows.
func (s *jobFlowLister) JobFlows(namespace string) JobFlowNamespaceLister {
return jobFlowNamespaceLister{indexer: s.indexer, namespace: namespace}
return jobFlowNamespaceLister{listers.NewNamespaced[*v1alpha1.JobFlow](s.ResourceIndexer, namespace)}
}
// JobFlowNamespaceLister helps list and get JobFlows.
@ -73,26 +65,5 @@ type JobFlowNamespaceLister interface {
// jobFlowNamespaceLister implements the JobFlowNamespaceLister
// interface.
type jobFlowNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all JobFlows in the indexer for a given namespace.
func (s jobFlowNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.JobFlow))
})
return ret, err
}
// Get retrieves the JobFlow from the indexer for a given namespace and name.
func (s jobFlowNamespaceLister) Get(name string) (*v1alpha1.JobFlow, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("jobflow"), name)
}
return obj.(*v1alpha1.JobFlow), nil
listers.ResourceIndexer[*v1alpha1.JobFlow]
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
@ -37,25 +37,17 @@ type JobTemplateLister interface {
// jobTemplateLister implements the JobTemplateLister interface.
type jobTemplateLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1alpha1.JobTemplate]
}
// NewJobTemplateLister returns a new JobTemplateLister.
func NewJobTemplateLister(indexer cache.Indexer) JobTemplateLister {
return &jobTemplateLister{indexer: indexer}
}
// List lists all JobTemplates in the indexer.
func (s *jobTemplateLister) List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.JobTemplate))
})
return ret, err
return &jobTemplateLister{listers.New[*v1alpha1.JobTemplate](indexer, v1alpha1.Resource("jobtemplate"))}
}
// JobTemplates returns an object that can list and get JobTemplates.
func (s *jobTemplateLister) JobTemplates(namespace string) JobTemplateNamespaceLister {
return jobTemplateNamespaceLister{indexer: s.indexer, namespace: namespace}
return jobTemplateNamespaceLister{listers.NewNamespaced[*v1alpha1.JobTemplate](s.ResourceIndexer, namespace)}
}
// JobTemplateNamespaceLister helps list and get JobTemplates.
@ -73,26 +65,5 @@ type JobTemplateNamespaceLister interface {
// jobTemplateNamespaceLister implements the JobTemplateNamespaceLister
// interface.
type jobTemplateNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all JobTemplates in the indexer for a given namespace.
func (s jobTemplateNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.JobTemplate))
})
return ret, err
}
// Get retrieves the JobTemplate from the indexer for a given namespace and name.
func (s jobTemplateNamespaceLister) Get(name string) (*v1alpha1.JobTemplate, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("jobtemplate"), name)
}
return obj.(*v1alpha1.JobTemplate), nil
listers.ResourceIndexer[*v1alpha1.JobTemplate]
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
)
@ -38,30 +38,10 @@ type NumatopologyLister interface {
// numatopologyLister implements the NumatopologyLister interface.
type numatopologyLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1alpha1.Numatopology]
}
// NewNumatopologyLister returns a new NumatopologyLister.
func NewNumatopologyLister(indexer cache.Indexer) NumatopologyLister {
return &numatopologyLister{indexer: indexer}
}
// List lists all Numatopologies in the indexer.
func (s *numatopologyLister) List(selector labels.Selector) (ret []*v1alpha1.Numatopology, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Numatopology))
})
return ret, err
}
// Get retrieves the Numatopology from the index for a given name.
func (s *numatopologyLister) Get(name string) (*v1alpha1.Numatopology, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("numatopology"), name)
}
return obj.(*v1alpha1.Numatopology), nil
return &numatopologyLister{listers.New[*v1alpha1.Numatopology](indexer, v1alpha1.Resource("numatopology"))}
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
@ -37,25 +37,17 @@ type PodGroupLister interface {
// podGroupLister implements the PodGroupLister interface.
type podGroupLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1beta1.PodGroup]
}
// NewPodGroupLister returns a new PodGroupLister.
func NewPodGroupLister(indexer cache.Indexer) PodGroupLister {
return &podGroupLister{indexer: indexer}
}
// List lists all PodGroups in the indexer.
func (s *podGroupLister) List(selector labels.Selector) (ret []*v1beta1.PodGroup, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.PodGroup))
})
return ret, err
return &podGroupLister{listers.New[*v1beta1.PodGroup](indexer, v1beta1.Resource("podgroup"))}
}
// PodGroups returns an object that can list and get PodGroups.
func (s *podGroupLister) PodGroups(namespace string) PodGroupNamespaceLister {
return podGroupNamespaceLister{indexer: s.indexer, namespace: namespace}
return podGroupNamespaceLister{listers.NewNamespaced[*v1beta1.PodGroup](s.ResourceIndexer, namespace)}
}
// PodGroupNamespaceLister helps list and get PodGroups.
@ -73,26 +65,5 @@ type PodGroupNamespaceLister interface {
// podGroupNamespaceLister implements the PodGroupNamespaceLister
// interface.
type podGroupNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all PodGroups in the indexer for a given namespace.
func (s podGroupNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.PodGroup, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.PodGroup))
})
return ret, err
}
// Get retrieves the PodGroup from the indexer for a given namespace and name.
func (s podGroupNamespaceLister) Get(name string) (*v1beta1.PodGroup, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1beta1.Resource("podgroup"), name)
}
return obj.(*v1beta1.PodGroup), nil
listers.ResourceIndexer[*v1beta1.PodGroup]
}

View File

@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
@ -38,30 +38,10 @@ type QueueLister interface {
// queueLister implements the QueueLister interface.
type queueLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*v1beta1.Queue]
}
// NewQueueLister returns a new QueueLister.
func NewQueueLister(indexer cache.Indexer) QueueLister {
return &queueLister{indexer: indexer}
}
// List lists all Queues in the indexer.
func (s *queueLister) List(selector labels.Selector) (ret []*v1beta1.Queue, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.Queue))
})
return ret, err
}
// Get retrieves the Queue from the index for a given name.
func (s *queueLister) Get(name string) (*v1beta1.Queue, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1beta1.Resource("queue"), name)
}
return obj.(*v1beta1.Queue), nil
return &queueLister{listers.New[*v1beta1.Queue](indexer, v1beta1.Resource("queue"))}
}