mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-22 07:03:28 +00:00
run update-codegen.sh
This commit is contained in:
148
pkg/apis/resource/v1/zz_generated.validations.go
generated
148
pkg/apis/resource/v1/zz_generated.validations.go
generated
@@ -146,6 +146,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceRequest)...)
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClaim) []resourcev1.DeviceRequest { return oldObj.Requests }))...)
|
||||
|
||||
@@ -161,6 +163,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceConstraint)...)
|
||||
return
|
||||
}(fldPath.Child("constraints"), obj.Constraints, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClaim) []resourcev1.DeviceConstraint { return oldObj.Constraints }))...)
|
||||
|
||||
@@ -176,12 +180,36 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceClaimConfiguration)...)
|
||||
return
|
||||
}(fldPath.Child("config"), obj.Config, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClaim) []resourcev1.DeviceClaimConfiguration { return oldObj.Config }))...)
|
||||
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClaimConfiguration validates an instance of DeviceClaimConfiguration according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceClaimConfiguration) (errs field.ErrorList) {
|
||||
// field resourcev1.DeviceClaimConfiguration.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClaimConfiguration) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1.DeviceClaimConfiguration.DeviceConfiguration has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClass validates an instance of DeviceClass according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceClass) (errs field.ErrorList) {
|
||||
@@ -267,6 +295,70 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceConstraint validates an instance of DeviceConstraint according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceConstraint) (errs field.ErrorList) {
|
||||
// field resourcev1.DeviceConstraint.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceConstraint) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1.DeviceConstraint.MatchAttribute has no validation
|
||||
// field resourcev1.DeviceConstraint.DistinctAttribute has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequest validates an instance of DeviceRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceRequest) (errs field.ErrorList) {
|
||||
// field resourcev1.DeviceRequest.Name has no validation
|
||||
|
||||
// field resourcev1.DeviceRequest.Exactly
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj *resourcev1.ExactDeviceRequest) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
|
||||
return // do not proceed
|
||||
}
|
||||
// call the type's validation function
|
||||
errs = append(errs, Validate_ExactDeviceRequest(ctx, op, fldPath, obj, oldObj)...)
|
||||
return
|
||||
}(fldPath.Child("exactly"), obj.Exactly, safe.Field(oldObj, func(oldObj *resourcev1.DeviceRequest) *resourcev1.ExactDeviceRequest { return oldObj.Exactly }))...)
|
||||
|
||||
// field resourcev1.DeviceRequest.FirstAvailable
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceSubRequest)...)
|
||||
return
|
||||
}(fldPath.Child("firstAvailable"), obj.FirstAvailable, safe.Field(oldObj, func(oldObj *resourcev1.DeviceRequest) []resourcev1.DeviceSubRequest { return oldObj.FirstAvailable }))...)
|
||||
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequestAllocationResult validates an instance of DeviceRequestAllocationResult according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceRequestAllocationResult) (errs field.ErrorList) {
|
||||
@@ -299,6 +391,62 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceSubRequest validates an instance of DeviceSubRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// field resourcev1.DeviceSubRequest.Name has no validation
|
||||
// field resourcev1.DeviceSubRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1.DeviceSubRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1.DeviceSubRequest) []resourcev1.DeviceSelector { return oldObj.Selectors }))...)
|
||||
|
||||
// field resourcev1.DeviceSubRequest.AllocationMode has no validation
|
||||
// field resourcev1.DeviceSubRequest.Count has no validation
|
||||
// field resourcev1.DeviceSubRequest.Tolerations has no validation
|
||||
// field resourcev1.DeviceSubRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_ExactDeviceRequest validates an instance of ExactDeviceRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.ExactDeviceRequest) (errs field.ErrorList) {
|
||||
// field resourcev1.ExactDeviceRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1.ExactDeviceRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1.ExactDeviceRequest) []resourcev1.DeviceSelector { return oldObj.Selectors }))...)
|
||||
|
||||
// field resourcev1.ExactDeviceRequest.AllocationMode has no validation
|
||||
// field resourcev1.ExactDeviceRequest.Count has no validation
|
||||
// field resourcev1.ExactDeviceRequest.AdminAccess has no validation
|
||||
// field resourcev1.ExactDeviceRequest.Tolerations has no validation
|
||||
// field resourcev1.ExactDeviceRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_ResourceClaim validates an instance of ResourceClaim according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.ResourceClaim) (errs field.ErrorList) {
|
||||
|
||||
149
pkg/apis/resource/v1beta1/zz_generated.validations.go
generated
149
pkg/apis/resource/v1beta1/zz_generated.validations.go
generated
@@ -148,6 +148,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceRequest)...)
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClaim) []resourcev1beta1.DeviceRequest { return oldObj.Requests }))...)
|
||||
|
||||
@@ -163,6 +165,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceConstraint)...)
|
||||
return
|
||||
}(fldPath.Child("constraints"), obj.Constraints, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClaim) []resourcev1beta1.DeviceConstraint {
|
||||
return oldObj.Constraints
|
||||
@@ -180,6 +184,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceClaimConfiguration)...)
|
||||
return
|
||||
}(fldPath.Child("config"), obj.Config, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClaim) []resourcev1beta1.DeviceClaimConfiguration {
|
||||
return oldObj.Config
|
||||
@@ -188,6 +194,28 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClaimConfiguration validates an instance of DeviceClaimConfiguration according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceClaimConfiguration) (errs field.ErrorList) {
|
||||
// field resourcev1beta1.DeviceClaimConfiguration.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClaimConfiguration) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1beta1.DeviceClaimConfiguration.DeviceConfiguration has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClass validates an instance of DeviceClass according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceClass) (errs field.ErrorList) {
|
||||
@@ -277,6 +305,78 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceConstraint validates an instance of DeviceConstraint according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceConstraint) (errs field.ErrorList) {
|
||||
// field resourcev1beta1.DeviceConstraint.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceConstraint) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1beta1.DeviceConstraint.MatchAttribute has no validation
|
||||
// field resourcev1beta1.DeviceConstraint.DistinctAttribute has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequest validates an instance of DeviceRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceRequest) (errs field.ErrorList) {
|
||||
// field resourcev1beta1.DeviceRequest.Name has no validation
|
||||
// field resourcev1beta1.DeviceRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1beta1.DeviceRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta1.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequest) []resourcev1beta1.DeviceSelector { return oldObj.Selectors }))...)
|
||||
|
||||
// field resourcev1beta1.DeviceRequest.AllocationMode has no validation
|
||||
// field resourcev1beta1.DeviceRequest.Count has no validation
|
||||
// field resourcev1beta1.DeviceRequest.AdminAccess has no validation
|
||||
|
||||
// field resourcev1beta1.DeviceRequest.FirstAvailable
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta1.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceSubRequest)...)
|
||||
return
|
||||
}(fldPath.Child("firstAvailable"), obj.FirstAvailable, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequest) []resourcev1beta1.DeviceSubRequest {
|
||||
return oldObj.FirstAvailable
|
||||
}))...)
|
||||
|
||||
// field resourcev1beta1.DeviceRequest.Tolerations has no validation
|
||||
// field resourcev1beta1.DeviceRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequestAllocationResult validates an instance of DeviceRequestAllocationResult according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceRequestAllocationResult) (errs field.ErrorList) {
|
||||
@@ -301,7 +401,24 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
|
||||
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.Device has no validation
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.AdminAccess has no validation
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.Tolerations has no validation
|
||||
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.Tolerations
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta1.DeviceToleration) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("tolerations"), obj.Tolerations, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequestAllocationResult) []resourcev1beta1.DeviceToleration {
|
||||
return oldObj.Tolerations
|
||||
}))...)
|
||||
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.BindingConditions has no validation
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.BindingFailureConditions has no validation
|
||||
// field resourcev1beta1.DeviceRequestAllocationResult.ShareID has no validation
|
||||
@@ -309,6 +426,36 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceSubRequest validates an instance of DeviceSubRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// field resourcev1beta1.DeviceSubRequest.Name has no validation
|
||||
// field resourcev1beta1.DeviceSubRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1beta1.DeviceSubRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta1.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceSubRequest) []resourcev1beta1.DeviceSelector {
|
||||
return oldObj.Selectors
|
||||
}))...)
|
||||
|
||||
// field resourcev1beta1.DeviceSubRequest.AllocationMode has no validation
|
||||
// field resourcev1beta1.DeviceSubRequest.Count has no validation
|
||||
// field resourcev1beta1.DeviceSubRequest.Tolerations has no validation
|
||||
// field resourcev1beta1.DeviceSubRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_ResourceClaim validates an instance of ResourceClaim according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.ResourceClaim) (errs field.ErrorList) {
|
||||
|
||||
154
pkg/apis/resource/v1beta2/zz_generated.validations.go
generated
154
pkg/apis/resource/v1beta2/zz_generated.validations.go
generated
@@ -148,6 +148,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceRequest)...)
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClaim) []resourcev1beta2.DeviceRequest { return oldObj.Requests }))...)
|
||||
|
||||
@@ -163,6 +165,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceConstraint)...)
|
||||
return
|
||||
}(fldPath.Child("constraints"), obj.Constraints, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClaim) []resourcev1beta2.DeviceConstraint {
|
||||
return oldObj.Constraints
|
||||
@@ -180,6 +184,8 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceClaimConfiguration)...)
|
||||
return
|
||||
}(fldPath.Child("config"), obj.Config, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClaim) []resourcev1beta2.DeviceClaimConfiguration {
|
||||
return oldObj.Config
|
||||
@@ -188,6 +194,28 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClaimConfiguration validates an instance of DeviceClaimConfiguration according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceClaimConfiguration) (errs field.ErrorList) {
|
||||
// field resourcev1beta2.DeviceClaimConfiguration.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClaimConfiguration) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1beta2.DeviceClaimConfiguration.DeviceConfiguration has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceClass validates an instance of DeviceClass according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceClass) (errs field.ErrorList) {
|
||||
@@ -277,6 +305,72 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceConstraint validates an instance of DeviceConstraint according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceConstraint) (errs field.ErrorList) {
|
||||
// field resourcev1beta2.DeviceConstraint.Requests
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []string) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceConstraint) []string { return oldObj.Requests }))...)
|
||||
|
||||
// field resourcev1beta2.DeviceConstraint.MatchAttribute has no validation
|
||||
// field resourcev1beta2.DeviceConstraint.DistinctAttribute has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequest validates an instance of DeviceRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceRequest) (errs field.ErrorList) {
|
||||
// field resourcev1beta2.DeviceRequest.Name has no validation
|
||||
|
||||
// field resourcev1beta2.DeviceRequest.Exactly
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj *resourcev1beta2.ExactDeviceRequest) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
|
||||
return // do not proceed
|
||||
}
|
||||
// call the type's validation function
|
||||
errs = append(errs, Validate_ExactDeviceRequest(ctx, op, fldPath, obj, oldObj)...)
|
||||
return
|
||||
}(fldPath.Child("exactly"), obj.Exactly, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceRequest) *resourcev1beta2.ExactDeviceRequest { return oldObj.Exactly }))...)
|
||||
|
||||
// field resourcev1beta2.DeviceRequest.FirstAvailable
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta2.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
// iterate the list and call the type's validation function
|
||||
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceSubRequest)...)
|
||||
return
|
||||
}(fldPath.Child("firstAvailable"), obj.FirstAvailable, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceRequest) []resourcev1beta2.DeviceSubRequest {
|
||||
return oldObj.FirstAvailable
|
||||
}))...)
|
||||
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceRequestAllocationResult validates an instance of DeviceRequestAllocationResult according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceRequestAllocationResult) (errs field.ErrorList) {
|
||||
@@ -309,6 +403,66 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_DeviceSubRequest validates an instance of DeviceSubRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceSubRequest) (errs field.ErrorList) {
|
||||
// field resourcev1beta2.DeviceSubRequest.Name has no validation
|
||||
// field resourcev1beta2.DeviceSubRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1beta2.DeviceSubRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta2.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceSubRequest) []resourcev1beta2.DeviceSelector {
|
||||
return oldObj.Selectors
|
||||
}))...)
|
||||
|
||||
// field resourcev1beta2.DeviceSubRequest.AllocationMode has no validation
|
||||
// field resourcev1beta2.DeviceSubRequest.Count has no validation
|
||||
// field resourcev1beta2.DeviceSubRequest.Tolerations has no validation
|
||||
// field resourcev1beta2.DeviceSubRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_ExactDeviceRequest validates an instance of ExactDeviceRequest according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.ExactDeviceRequest) (errs field.ErrorList) {
|
||||
// field resourcev1beta2.ExactDeviceRequest.DeviceClassName has no validation
|
||||
|
||||
// field resourcev1beta2.ExactDeviceRequest.Selectors
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj []resourcev1beta2.DeviceSelector) (errs field.ErrorList) {
|
||||
// don't revalidate unchanged data
|
||||
if op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
|
||||
return nil
|
||||
}
|
||||
// call field-attached validations
|
||||
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
|
||||
errs = append(errs, e...)
|
||||
return // do not proceed
|
||||
}
|
||||
return
|
||||
}(fldPath.Child("selectors"), obj.Selectors, safe.Field(oldObj, func(oldObj *resourcev1beta2.ExactDeviceRequest) []resourcev1beta2.DeviceSelector {
|
||||
return oldObj.Selectors
|
||||
}))...)
|
||||
|
||||
// field resourcev1beta2.ExactDeviceRequest.AllocationMode has no validation
|
||||
// field resourcev1beta2.ExactDeviceRequest.Count has no validation
|
||||
// field resourcev1beta2.ExactDeviceRequest.AdminAccess has no validation
|
||||
// field resourcev1beta2.ExactDeviceRequest.Tolerations has no validation
|
||||
// field resourcev1beta2.ExactDeviceRequest.Capacity has no validation
|
||||
return errs
|
||||
}
|
||||
|
||||
// Validate_ResourceClaim validates an instance of ResourceClaim according
|
||||
// to declarative validation rules in the API schema.
|
||||
func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.ResourceClaim) (errs field.ErrorList) {
|
||||
|
||||
@@ -592,6 +592,7 @@ message DeviceClaimConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
optional DeviceConfiguration deviceConfiguration = 2;
|
||||
@@ -698,6 +699,7 @@ message DeviceConstraint {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
// MatchAttribute requires that all devices in question have this
|
||||
@@ -780,6 +782,7 @@ message DeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=deviceRequestType
|
||||
// +k8s:optional
|
||||
optional ExactDeviceRequest exactly = 2;
|
||||
|
||||
// FirstAvailable contains subrequests, of which exactly one will be
|
||||
@@ -800,6 +803,7 @@ message DeviceRequest {
|
||||
// +oneOf=deviceRequestType
|
||||
// +listType=atomic
|
||||
// +featureGate=DRAPrioritizedList
|
||||
// +k8s:maxItems=8
|
||||
repeated DeviceSubRequest firstAvailable = 3;
|
||||
}
|
||||
|
||||
@@ -962,6 +966,7 @@ message DeviceSubRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 3;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -1133,6 +1138,7 @@ message ExactDeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 2;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
|
||||
@@ -600,6 +600,7 @@ message DeviceClaimConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
optional DeviceConfiguration deviceConfiguration = 2;
|
||||
@@ -706,6 +707,7 @@ message DeviceConstraint {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
// MatchAttribute requires that all devices in question have this
|
||||
@@ -804,6 +806,7 @@ message DeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 3;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -878,6 +881,7 @@ message DeviceRequest {
|
||||
// +oneOf=deviceRequestType
|
||||
// +listType=atomic
|
||||
// +featureGate=DRAPrioritizedList
|
||||
// +k8s:maxItems=8
|
||||
repeated DeviceSubRequest firstAvailable = 7;
|
||||
|
||||
// If specified, the request's tolerations.
|
||||
@@ -987,6 +991,7 @@ message DeviceRequestAllocationResult {
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:maxItems=16
|
||||
repeated DeviceToleration tolerations = 6;
|
||||
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
@@ -1084,6 +1089,7 @@ message DeviceSubRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 3;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
|
||||
@@ -592,6 +592,7 @@ message DeviceClaimConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
optional DeviceConfiguration deviceConfiguration = 2;
|
||||
@@ -698,6 +699,7 @@ message DeviceConstraint {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
// MatchAttribute requires that all devices in question have this
|
||||
@@ -780,6 +782,7 @@ message DeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=deviceRequestType
|
||||
// +k8s:optional
|
||||
optional ExactDeviceRequest exactly = 2;
|
||||
|
||||
// FirstAvailable contains subrequests, of which exactly one will be
|
||||
@@ -800,6 +803,7 @@ message DeviceRequest {
|
||||
// +oneOf=deviceRequestType
|
||||
// +listType=atomic
|
||||
// +featureGate=DRAPrioritizedList
|
||||
// +k8s:maxItems=8
|
||||
repeated DeviceSubRequest firstAvailable = 3;
|
||||
}
|
||||
|
||||
@@ -962,6 +966,7 @@ message DeviceSubRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 3;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -1133,6 +1138,7 @@ message ExactDeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 2;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
|
||||
Reference in New Issue
Block a user