validation-gen: Fix all stable api violations by prefixing +k8s:alpha(since:"1.36") and exclude output_tests from linting

This commit is contained in:
Your Name 2026-02-24 22:43:53 +00:00
parent d1f11ee860
commit 701db6b6a6
107 changed files with 1786 additions and 1799 deletions

View file

@ -85,7 +85,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -109,7 +109,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -85,7 +85,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -109,7 +109,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -85,7 +85,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -109,7 +109,7 @@ func Validate_ValidatingAdmissionPolicyBindingSpec(ctx context.Context, op opera
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -77,13 +77,12 @@ func Validate_ScaleSpec(ctx context.Context, op operation.Operation, fldPath *fi
// field appsv1beta1.ScaleSpec.Replicas
errs = append(errs,
func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
// optional value-type fields with zero-value defaults are purely documentation
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
return nil
}
// call field-attached validations
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("replicas"), &obj.Replicas, safe.Field(oldObj, func(oldObj *appsv1beta1.ScaleSpec) *int32 { return &oldObj.Replicas }), oldObj != nil)...)

View file

@ -77,13 +77,12 @@ func Validate_ScaleSpec(ctx context.Context, op operation.Operation, fldPath *fi
// field appsv1beta2.ScaleSpec.Replicas
errs = append(errs,
func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
// optional value-type fields with zero-value defaults are purely documentation
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
return nil
}
// call field-attached validations
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("replicas"), &obj.Replicas, safe.Field(oldObj, func(oldObj *appsv1beta2.ScaleSpec) *int32 { return &oldObj.Replicas }), oldObj != nil)...)

View file

@ -96,18 +96,18 @@ func Validate_HorizontalPodAutoscalerSpec(ctx context.Context, op operation.Oper
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", false, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)
})...)
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", true, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)
})...)
}).MarkAlpha()...)
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", false, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)
}).MarkAlpha()...)
return
}(fldPath.Child("minReplicas"), obj.MinReplicas, safe.Field(oldObj, func(oldObj *autoscalingv1.HorizontalPodAutoscalerSpec) *int32 { return oldObj.MinReplicas }), oldObj != nil)...)
@ -120,14 +120,14 @@ func Validate_HorizontalPodAutoscalerSpec(ctx context.Context, op operation.Oper
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1).MarkAlpha()...)
return
}(fldPath.Child("maxReplicas"), &obj.MaxReplicas, safe.Field(oldObj, func(oldObj *autoscalingv1.HorizontalPodAutoscalerSpec) *int32 { return &oldObj.MaxReplicas }), oldObj != nil)...)
@ -163,13 +163,12 @@ func Validate_ScaleSpec(ctx context.Context, op operation.Operation, fldPath *fi
// field autoscalingv1.ScaleSpec.Replicas
errs = append(errs,
func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
// optional value-type fields with zero-value defaults are purely documentation
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
return nil
}
// call field-attached validations
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("replicas"), &obj.Replicas, safe.Field(oldObj, func(oldObj *autoscalingv1.ScaleSpec) *int32 { return &oldObj.Replicas }), oldObj != nil)...)

View file

@ -88,18 +88,18 @@ func Validate_HorizontalPodAutoscalerSpec(ctx context.Context, op operation.Oper
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", false, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)
})...)
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", true, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)
})...)
}).MarkAlpha()...)
errs = append(errs, validate.IfOption(ctx, op, fldPath, obj, oldObj, "HPAScaleToZero", false, func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *int32) field.ErrorList {
return validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)
}).MarkAlpha()...)
return
}(fldPath.Child("minReplicas"), obj.MinReplicas, safe.Field(oldObj, func(oldObj *autoscalingv2.HorizontalPodAutoscalerSpec) *int32 { return oldObj.MinReplicas }), oldObj != nil)...)
@ -112,14 +112,14 @@ func Validate_HorizontalPodAutoscalerSpec(ctx context.Context, op operation.Oper
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1).MarkAlpha()...)
return
}(fldPath.Child("maxReplicas"), &obj.MaxReplicas, safe.Field(oldObj, func(oldObj *autoscalingv2.HorizontalPodAutoscalerSpec) *int32 { return &oldObj.MaxReplicas }), oldObj != nil)...)

View file

@ -52,7 +52,7 @@ func TestScaleDeclarativeValidation(t *testing.T) {
"spec.replicas: negative replicas": {
input: mkScale(setScaleSpecReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
}

View file

@ -84,7 +84,7 @@ func Validate_CronJobSpec(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -84,7 +84,7 @@ func Validate_CronJobSpec(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -89,7 +89,7 @@ func Validate_CertificateSigningRequestStatus(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {

View file

@ -89,7 +89,7 @@ func Validate_CertificateSigningRequestStatus(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {

View file

@ -66,13 +66,13 @@ func Validate_ReplicationController(ctx context.Context, op operation.Operation,
// call field-attached validations
func() { // cohort name
earlyReturn := false
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue); len(e) != 0 {
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName)...)
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName).MarkAlpha()...)
}()
return
}(fldPath.Child("metadata"), &obj.ObjectMeta, safe.Field(oldObj, func(oldObj *corev1.ReplicationController) *metav1.ObjectMeta { return &oldObj.ObjectMeta }), oldObj != nil)...)
@ -106,27 +106,26 @@ func Validate_ReplicationControllerSpec(ctx context.Context, op operation.Operat
// call field-attached validations
earlyReturn := false
// optional fields with default values are effectively required
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("replicas"), obj.Replicas, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerSpec) *int32 { return oldObj.Replicas }), oldObj != nil)...)
// field corev1.ReplicationControllerSpec.MinReadySeconds
errs = append(errs,
func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
// optional value-type fields with zero-value defaults are purely documentation
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
return nil
}
// call field-attached validations
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("minReadySeconds"), &obj.MinReadySeconds, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerSpec) *int32 { return &oldObj.MinReadySeconds }), oldObj != nil)...)

View file

@ -56,7 +56,7 @@ var symbolsForAddressType = sets.New(discoveryv1.AddressTypeFQDN, discoveryv1.Ad
// Validate_AddressType validates an instance of AddressType according
// to declarative validation rules in the API schema.
func Validate_AddressType(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *discoveryv1.AddressType) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAddressType, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAddressType, nil).MarkAlpha()...)
return errs
}
@ -73,11 +73,11 @@ func Validate_Endpoint(ctx context.Context, op operation.Operation, fldPath *fie
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 100); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 100).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -112,11 +112,11 @@ func Validate_EndpointSlice(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -137,7 +137,7 @@ func Validate_EndpointSlice(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {

View file

@ -56,7 +56,7 @@ var symbolsForAddressType = sets.New(discoveryv1beta1.AddressTypeFQDN, discovery
// Validate_AddressType validates an instance of AddressType according
// to declarative validation rules in the API schema.
func Validate_AddressType(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *discoveryv1beta1.AddressType) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAddressType, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAddressType, nil).MarkAlpha()...)
return errs
}
@ -73,11 +73,11 @@ func Validate_Endpoint(ctx context.Context, op operation.Operation, fldPath *fie
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 100); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 100).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -111,11 +111,11 @@ func Validate_EndpointSlice(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -136,7 +136,7 @@ func Validate_EndpointSlice(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {

View file

@ -99,11 +99,11 @@ func Validate_IPAddressSpec(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -130,7 +130,7 @@ func Validate_IPBlock(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -179,7 +179,7 @@ func Validate_IngressClassParametersReference(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -198,7 +198,7 @@ func Validate_IngressClassParametersReference(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -227,7 +227,7 @@ func Validate_IngressClassSpec(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -278,7 +278,7 @@ func Validate_NetworkPolicyEgressRule(ctx context.Context, op operation.Operatio
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -306,7 +306,7 @@ func Validate_NetworkPolicyIngressRule(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -337,7 +337,7 @@ func Validate_NetworkPolicyPeer(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -365,7 +365,7 @@ func Validate_NetworkPolicySpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -387,7 +387,7 @@ func Validate_NetworkPolicySpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -418,7 +418,7 @@ func Validate_ParentReference(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -439,7 +439,7 @@ func Validate_ParentReference(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -91,11 +91,11 @@ func Validate_IPAddressSpec(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -147,7 +147,7 @@ func Validate_IngressClassParametersReference(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -166,7 +166,7 @@ func Validate_IngressClassParametersReference(ctx context.Context, op operation.
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -195,7 +195,7 @@ func Validate_IngressClassSpec(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -225,7 +225,7 @@ func Validate_ParentReference(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -246,7 +246,7 @@ func Validate_ParentReference(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -64,18 +64,18 @@ func Validate_RuntimeClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("handler"), &obj.Handler, safe.Field(oldObj, func(oldObj *nodev1.RuntimeClass) *string { return &oldObj.Handler }), oldObj != nil)...)

View file

@ -83,18 +83,18 @@ func Validate_RuntimeClassSpec(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("runtimeHandler"), &obj.RuntimeHandler, safe.Field(oldObj, func(oldObj *nodev1alpha1.RuntimeClassSpec) *string { return &oldObj.RuntimeHandler }), oldObj != nil)...)

View file

@ -64,18 +64,18 @@ func Validate_RuntimeClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("handler"), &obj.Handler, safe.Field(oldObj, func(oldObj *nodev1beta1.RuntimeClass) *string { return &oldObj.Handler }), oldObj != nil)...)

View file

@ -89,7 +89,7 @@ func Validate_ClusterRole(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -119,7 +119,7 @@ func Validate_ClusterRoleBinding(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -157,7 +157,7 @@ func Validate_PolicyRule(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -189,7 +189,7 @@ func Validate_Role(ctx context.Context, op operation.Operation, fldPath *field.P
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -218,7 +218,7 @@ func Validate_RoleBinding(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -259,7 +259,7 @@ func Validate_RoleRef(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -287,7 +287,7 @@ func Validate_Subject(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -89,7 +89,7 @@ func Validate_ClusterRole(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -119,7 +119,7 @@ func Validate_ClusterRoleBinding(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -157,7 +157,7 @@ func Validate_PolicyRule(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -189,7 +189,7 @@ func Validate_Role(ctx context.Context, op operation.Operation, fldPath *field.P
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -218,7 +218,7 @@ func Validate_RoleBinding(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -259,7 +259,7 @@ func Validate_RoleRef(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -287,7 +287,7 @@ func Validate_Subject(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -89,7 +89,7 @@ func Validate_ClusterRole(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -119,7 +119,7 @@ func Validate_ClusterRoleBinding(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -157,7 +157,7 @@ func Validate_PolicyRule(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -189,7 +189,7 @@ func Validate_Role(ctx context.Context, op operation.Operation, fldPath *field.P
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -218,7 +218,7 @@ func Validate_RoleBinding(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -259,7 +259,7 @@ func Validate_RoleRef(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -287,7 +287,7 @@ func Validate_Subject(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}

View file

@ -93,13 +93,13 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1.AllocatedDeviceStatus) *string { return oldObj.ShareID }), oldObj != nil)...)
@ -115,7 +115,7 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -136,7 +136,7 @@ var symbolsForAllocationConfigSource = sets.New(resourcev1.AllocationConfigSourc
// Validate_AllocationConfigSource validates an instance of AllocationConfigSource according
// to declarative validation rules in the API schema.
func Validate_AllocationConfigSource(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.AllocationConfigSource) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil).MarkAlpha()...)
return errs
}
@ -173,14 +173,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("name"), &obj.Name, safe.Field(oldObj, func(oldObj *resourcev1.CounterSet) *string { return &oldObj.Name }), oldObj != nil)...)
@ -193,14 +193,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1.CounterSet) map[string]resourcev1.Counter { return oldObj.Counters }), oldObj != nil)...)
@ -221,7 +221,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -245,11 +245,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -258,7 +258,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceCounterConsumption, b resourcev1.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceCounterConsumption, b resourcev1.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
@ -279,7 +279,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -301,11 +301,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -323,11 +323,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -352,7 +352,7 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -375,18 +375,18 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceAllocationConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -412,7 +412,7 @@ var symbolsForDeviceAllocationMode = sets.New(resourcev1.DeviceAllocationModeAll
// Validate_DeviceAllocationMode validates an instance of DeviceAllocationMode according
// to declarative validation rules in the API schema.
func Validate_DeviceAllocationMode(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceAllocationMode) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil).MarkAlpha()...)
return errs
}
@ -429,11 +429,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -455,11 +455,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -500,7 +500,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
return false
}
return obj.VersionValue != nil
})...)
}).MarkAlpha()...)
// field resourcev1.DeviceAttribute.IntValue
errs = append(errs,
@ -511,7 +511,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -529,7 +529,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -547,7 +547,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -565,7 +565,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -589,18 +589,18 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceRequest, b resourcev1.DeviceRequest) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceRequest, b resourcev1.DeviceRequest) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceRequest, b resourcev1.DeviceRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceRequest)...)
return
@ -615,11 +615,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -639,11 +639,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -669,18 +669,18 @@ func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClaimConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -716,13 +716,13 @@ func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *
// call field-attached validations
func() { // cohort name
earlyReturn := false
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue); len(e) != 0 {
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName)...)
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName).MarkAlpha()...)
}()
return
}(fldPath.Child("metadata"), &obj.ObjectMeta, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClass) *metav1.ObjectMeta { return &oldObj.ObjectMeta }), oldObj != nil)...)
@ -774,11 +774,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -796,11 +796,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -820,13 +820,13 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("extendedResourceName"), obj.ExtendedResourceName, safe.Field(oldObj, func(oldObj *resourcev1.DeviceClassSpec) *string { return oldObj.ExtendedResourceName }), oldObj != nil)...)
@ -845,7 +845,7 @@ func Validate_DeviceConfiguration(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -873,18 +873,18 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1.DeviceConstraint) []string { return oldObj.Requests }), oldObj != nil)...)
@ -897,13 +897,13 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("matchAttribute"), obj.MatchAttribute, safe.Field(oldObj, func(oldObj *resourcev1.DeviceConstraint) *resourcev1.FullyQualifiedName { return oldObj.MatchAttribute }), oldObj != nil)...)
@ -923,14 +923,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("counterSet"), &obj.CounterSet, safe.Field(oldObj, func(oldObj *resourcev1.DeviceCounterConsumption) *string { return &oldObj.CounterSet }), oldObj != nil)...)
@ -943,14 +943,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1.DeviceCounterConsumption) map[string]resourcev1.Counter {
return oldObj.Counters
@ -973,7 +973,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -993,18 +993,18 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceSubRequest, b resourcev1.DeviceSubRequest) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceSubRequest, b resourcev1.DeviceSubRequest) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1.DeviceSubRequest, b resourcev1.DeviceSubRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceSubRequest)...)
return
@ -1027,15 +1027,15 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1.DeviceRequestAllocationResult) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1048,14 +1048,14 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("pool"), &obj.Pool, safe.Field(oldObj, func(oldObj *resourcev1.DeviceRequestAllocationResult) *string { return &oldObj.Pool }), oldObj != nil)...)
@ -1071,7 +1071,7 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1093,11 +1093,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1115,11 +1115,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1139,13 +1139,13 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1.DeviceRequestAllocationResult) *types.UID { return oldObj.ShareID }), oldObj != nil)...)
@ -1167,14 +1167,14 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("deviceClassName"), &obj.DeviceClassName, safe.Field(oldObj, func(oldObj *resourcev1.DeviceSubRequest) *string { return &oldObj.DeviceClassName }), oldObj != nil)...)
@ -1187,11 +1187,11 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1209,7 +1209,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1233,7 +1233,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1263,7 +1263,7 @@ func Validate_DeviceTaint(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1284,7 +1284,7 @@ var symbolsForDeviceTaintEffect = sets.New(resourcev1.DeviceTaintEffectNoExecute
// Validate_DeviceTaintEffect validates an instance of DeviceTaintEffect according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintEffect(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceTaintEffect) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil).MarkAlpha()...)
return errs
}
@ -1301,13 +1301,13 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("key"), &obj.Key, safe.Field(oldObj, func(oldObj *resourcev1.DeviceToleration) *string { return &oldObj.Key }), oldObj != nil)...)
@ -1321,7 +1321,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
// call field-attached validations
earlyReturn := false
// optional fields with default values are effectively required
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1346,7 +1346,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1366,7 +1366,7 @@ var symbolsForDeviceTolerationOperator = sets.New(resourcev1.DeviceTolerationOpE
// Validate_DeviceTolerationOperator validates an instance of DeviceTolerationOperator according
// to declarative validation rules in the API schema.
func Validate_DeviceTolerationOperator(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1.DeviceTolerationOperator) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil).MarkAlpha()...)
return errs
}
@ -1385,11 +1385,11 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1407,7 +1407,7 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1432,7 +1432,7 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1459,13 +1459,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha()...)
return
}(fldPath.Child("interfaceName"), &obj.InterfaceName, safe.Field(oldObj, func(oldObj *resourcev1.NetworkDeviceData) *string { return &oldObj.InterfaceName }), oldObj != nil)...)
@ -1478,18 +1478,18 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("ips"), obj.IPs, safe.Field(oldObj, func(oldObj *resourcev1.NetworkDeviceData) []string { return oldObj.IPs }), oldObj != nil)...)
@ -1502,13 +1502,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128).MarkAlpha()...)
return
}(fldPath.Child("hardwareAddress"), &obj.HardwareAddress, safe.Field(oldObj, func(oldObj *resourcev1.NetworkDeviceData) *string { return &oldObj.HardwareAddress }), oldObj != nil)...)
@ -1527,15 +1527,15 @@ func Validate_OpaqueDeviceConfiguration(ctx context.Context, op operation.Operat
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1.OpaqueDeviceConfiguration) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1558,7 +1558,7 @@ func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1615,10 +1615,10 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify); len(e) != 0 {
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1639,11 +1639,11 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1652,7 +1652,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.ResourceClaimConsumerReference, b resourcev1.ResourceClaimConsumerReference) bool {
return a.UID == b.UID
})...)
}).MarkAlpha()...)
return
}(fldPath.Child("reservedFor"), obj.ReservedFor, safe.Field(oldObj, func(oldObj *resourcev1.ResourceClaimStatus) []resourcev1.ResourceClaimConsumerReference {
return oldObj.ReservedFor
@ -1667,7 +1667,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1676,7 +1676,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.AllocatedDeviceStatus, b resourcev1.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1.AllocatedDeviceStatus, b resourcev1.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
@ -1769,7 +1769,7 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1791,18 +1791,18 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.CounterSet, b resourcev1.CounterSet) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1.CounterSet, b resourcev1.CounterSet) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1.CounterSet, b resourcev1.CounterSet) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CounterSet)...)
return

View file

@ -93,13 +93,13 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1beta1.AllocatedDeviceStatus) *string { return oldObj.ShareID }), oldObj != nil)...)
@ -115,7 +115,7 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -136,7 +136,7 @@ var symbolsForAllocationConfigSource = sets.New(resourcev1beta1.AllocationConfig
// Validate_AllocationConfigSource validates an instance of AllocationConfigSource according
// to declarative validation rules in the API schema.
func Validate_AllocationConfigSource(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.AllocationConfigSource) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil).MarkAlpha()...)
return errs
}
@ -175,7 +175,7 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -199,11 +199,11 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -212,7 +212,7 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceCounterConsumption, b resourcev1beta1.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceCounterConsumption, b resourcev1beta1.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
@ -235,7 +235,7 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -257,11 +257,11 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -279,11 +279,11 @@ func Validate_BasicDevice(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -308,14 +308,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("name"), &obj.Name, safe.Field(oldObj, func(oldObj *resourcev1beta1.CounterSet) *string { return &oldObj.Name }), oldObj != nil)...)
@ -328,14 +328,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1beta1.CounterSet) map[string]resourcev1beta1.Counter { return oldObj.Counters }), oldObj != nil)...)
@ -356,7 +356,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -382,7 +382,7 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -405,18 +405,18 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceAllocationConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -442,7 +442,7 @@ var symbolsForDeviceAllocationMode = sets.New(resourcev1beta1.DeviceAllocationMo
// Validate_DeviceAllocationMode validates an instance of DeviceAllocationMode according
// to declarative validation rules in the API schema.
func Validate_DeviceAllocationMode(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceAllocationMode) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil).MarkAlpha()...)
return errs
}
@ -459,11 +459,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -485,11 +485,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -530,7 +530,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
return false
}
return obj.VersionValue != nil
})...)
}).MarkAlpha()...)
// field resourcev1beta1.DeviceAttribute.IntValue
errs = append(errs,
@ -541,7 +541,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -559,7 +559,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -577,7 +577,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -595,7 +595,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -619,18 +619,18 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceRequest, b resourcev1beta1.DeviceRequest) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceRequest, b resourcev1beta1.DeviceRequest) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceRequest, b resourcev1beta1.DeviceRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceRequest)...)
return
@ -645,11 +645,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -671,11 +671,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -703,18 +703,18 @@ func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClaimConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -750,13 +750,13 @@ func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *
// call field-attached validations
func() { // cohort name
earlyReturn := false
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue); len(e) != 0 {
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName)...)
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName).MarkAlpha()...)
}()
return
}(fldPath.Child("metadata"), &obj.ObjectMeta, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClass) *v1.ObjectMeta { return &oldObj.ObjectMeta }), oldObj != nil)...)
@ -808,11 +808,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -832,11 +832,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -858,13 +858,13 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("extendedResourceName"), obj.ExtendedResourceName, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceClassSpec) *string { return oldObj.ExtendedResourceName }), oldObj != nil)...)
@ -883,7 +883,7 @@ func Validate_DeviceConfiguration(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -911,18 +911,18 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceConstraint) []string { return oldObj.Requests }), oldObj != nil)...)
@ -935,13 +935,13 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("matchAttribute"), obj.MatchAttribute, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceConstraint) *resourcev1beta1.FullyQualifiedName {
return oldObj.MatchAttribute
@ -963,14 +963,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("counterSet"), &obj.CounterSet, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceCounterConsumption) *string { return &oldObj.CounterSet }), oldObj != nil)...)
@ -983,14 +983,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceCounterConsumption) map[string]resourcev1beta1.Counter {
return oldObj.Counters
@ -1014,11 +1014,11 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1036,7 +1036,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1061,11 +1061,11 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1074,7 +1074,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceSubRequest, b resourcev1beta1.DeviceSubRequest) bool {
return a.Name == b.Name
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.DeviceSubRequest, b resourcev1beta1.DeviceSubRequest) bool {
return a.Name == b.Name
@ -1093,7 +1093,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1124,15 +1124,15 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequestAllocationResult) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1145,14 +1145,14 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("pool"), &obj.Pool, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequestAllocationResult) *string { return &oldObj.Pool }), oldObj != nil)...)
@ -1168,11 +1168,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1194,11 +1194,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1216,11 +1216,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1240,13 +1240,13 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceRequestAllocationResult) *types.UID { return oldObj.ShareID }), oldObj != nil)...)
@ -1268,14 +1268,14 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("deviceClassName"), &obj.DeviceClassName, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceSubRequest) *string { return &oldObj.DeviceClassName }), oldObj != nil)...)
@ -1288,11 +1288,11 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1312,7 +1312,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1336,7 +1336,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1368,7 +1368,7 @@ func Validate_DeviceTaint(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1389,7 +1389,7 @@ var symbolsForDeviceTaintEffect = sets.New(resourcev1beta1.DeviceTaintEffectNoEx
// Validate_DeviceTaintEffect validates an instance of DeviceTaintEffect according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintEffect(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceTaintEffect) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil).MarkAlpha()...)
return errs
}
@ -1406,13 +1406,13 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("key"), &obj.Key, safe.Field(oldObj, func(oldObj *resourcev1beta1.DeviceToleration) *string { return &oldObj.Key }), oldObj != nil)...)
@ -1426,7 +1426,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
// call field-attached validations
earlyReturn := false
// optional fields with default values are effectively required
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1451,7 +1451,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1473,7 +1473,7 @@ var symbolsForDeviceTolerationOperator = sets.New(resourcev1beta1.DeviceTolerati
// Validate_DeviceTolerationOperator validates an instance of DeviceTolerationOperator according
// to declarative validation rules in the API schema.
func Validate_DeviceTolerationOperator(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta1.DeviceTolerationOperator) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil).MarkAlpha()...)
return errs
}
@ -1490,13 +1490,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha()...)
return
}(fldPath.Child("interfaceName"), &obj.InterfaceName, safe.Field(oldObj, func(oldObj *resourcev1beta1.NetworkDeviceData) *string { return &oldObj.InterfaceName }), oldObj != nil)...)
@ -1509,18 +1509,18 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("ips"), obj.IPs, safe.Field(oldObj, func(oldObj *resourcev1beta1.NetworkDeviceData) []string { return oldObj.IPs }), oldObj != nil)...)
@ -1533,13 +1533,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128).MarkAlpha()...)
return
}(fldPath.Child("hardwareAddress"), &obj.HardwareAddress, safe.Field(oldObj, func(oldObj *resourcev1beta1.NetworkDeviceData) *string { return &oldObj.HardwareAddress }), oldObj != nil)...)
@ -1558,15 +1558,15 @@ func Validate_OpaqueDeviceConfiguration(ctx context.Context, op operation.Operat
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1beta1.OpaqueDeviceConfiguration) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1589,7 +1589,7 @@ func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1648,10 +1648,10 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify); len(e) != 0 {
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1674,11 +1674,11 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1687,7 +1687,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.ResourceClaimConsumerReference, b resourcev1beta1.ResourceClaimConsumerReference) bool {
return a.UID == b.UID
})...)
}).MarkAlpha()...)
return
}(fldPath.Child("reservedFor"), obj.ReservedFor, safe.Field(oldObj, func(oldObj *resourcev1beta1.ResourceClaimStatus) []resourcev1beta1.ResourceClaimConsumerReference {
return oldObj.ReservedFor
@ -1702,7 +1702,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1711,7 +1711,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.AllocatedDeviceStatus, b resourcev1beta1.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.AllocatedDeviceStatus, b resourcev1beta1.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
@ -1808,7 +1808,7 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1830,18 +1830,18 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.CounterSet, b resourcev1beta1.CounterSet) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.CounterSet, b resourcev1beta1.CounterSet) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta1.CounterSet, b resourcev1beta1.CounterSet) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CounterSet)...)
return

View file

@ -93,13 +93,13 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1beta2.AllocatedDeviceStatus) *string { return oldObj.ShareID }), oldObj != nil)...)
@ -115,7 +115,7 @@ func Validate_AllocatedDeviceStatus(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -136,7 +136,7 @@ var symbolsForAllocationConfigSource = sets.New(resourcev1beta2.AllocationConfig
// Validate_AllocationConfigSource validates an instance of AllocationConfigSource according
// to declarative validation rules in the API schema.
func Validate_AllocationConfigSource(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.AllocationConfigSource) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil).MarkAlpha()...)
return errs
}
@ -175,14 +175,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("name"), &obj.Name, safe.Field(oldObj, func(oldObj *resourcev1beta2.CounterSet) *string { return &oldObj.Name }), oldObj != nil)...)
@ -195,14 +195,14 @@ func Validate_CounterSet(ctx context.Context, op operation.Operation, fldPath *f
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1beta2.CounterSet) map[string]resourcev1beta2.Counter { return oldObj.Counters }), oldObj != nil)...)
@ -223,7 +223,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -247,11 +247,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -260,7 +260,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceCounterConsumption, b resourcev1beta2.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceCounterConsumption, b resourcev1beta2.DeviceCounterConsumption) bool {
return a.CounterSet == b.CounterSet
@ -283,7 +283,7 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -305,11 +305,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -327,11 +327,11 @@ func Validate_Device(ctx context.Context, op operation.Operation, fldPath *field
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -356,7 +356,7 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -379,18 +379,18 @@ func Validate_DeviceAllocationConfiguration(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceAllocationConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -416,7 +416,7 @@ var symbolsForDeviceAllocationMode = sets.New(resourcev1beta2.DeviceAllocationMo
// Validate_DeviceAllocationMode validates an instance of DeviceAllocationMode according
// to declarative validation rules in the API schema.
func Validate_DeviceAllocationMode(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceAllocationMode) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil).MarkAlpha()...)
return errs
}
@ -433,11 +433,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -459,11 +459,11 @@ func Validate_DeviceAllocationResult(ctx context.Context, op operation.Operation
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -504,7 +504,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
return false
}
return obj.VersionValue != nil
})...)
}).MarkAlpha()...)
// field resourcev1beta2.DeviceAttribute.IntValue
errs = append(errs,
@ -515,7 +515,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -533,7 +533,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -551,7 +551,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -569,7 +569,7 @@ func Validate_DeviceAttribute(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -593,18 +593,18 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceRequest, b resourcev1beta2.DeviceRequest) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceRequest, b resourcev1beta2.DeviceRequest) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceRequest, b resourcev1beta2.DeviceRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceRequest)...)
return
@ -619,11 +619,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -645,11 +645,11 @@ func Validate_DeviceClaim(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -677,18 +677,18 @@ func Validate_DeviceClaimConfiguration(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClaimConfiguration) []string { return oldObj.Requests }), oldObj != nil)...)
@ -724,13 +724,13 @@ func Validate_DeviceClass(ctx context.Context, op operation.Operation, fldPath *
// call field-attached validations
func() { // cohort name
earlyReturn := false
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue); len(e) != 0 {
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.OptionalValue).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName)...)
errs = append(errs, validate.Subfield(ctx, op, fldPath, obj, oldObj, "name", func(o *v1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName).MarkAlpha()...)
}()
return
}(fldPath.Child("metadata"), &obj.ObjectMeta, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClass) *v1.ObjectMeta { return &oldObj.ObjectMeta }), oldObj != nil)...)
@ -782,11 +782,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -806,11 +806,11 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -832,13 +832,13 @@ func Validate_DeviceClassSpec(ctx context.Context, op operation.Operation, fldPa
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("extendedResourceName"), obj.ExtendedResourceName, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceClassSpec) *string { return oldObj.ExtendedResourceName }), oldObj != nil)...)
@ -857,7 +857,7 @@ func Validate_DeviceConfiguration(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -885,18 +885,18 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("requests"), obj.Requests, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceConstraint) []string { return oldObj.Requests }), oldObj != nil)...)
@ -909,13 +909,13 @@ func Validate_DeviceConstraint(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("matchAttribute"), obj.MatchAttribute, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceConstraint) *resourcev1beta2.FullyQualifiedName {
return oldObj.MatchAttribute
@ -937,14 +937,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("counterSet"), &obj.CounterSet, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceCounterConsumption) *string { return &oldObj.CounterSet }), oldObj != nil)...)
@ -957,14 +957,14 @@ func Validate_DeviceCounterConsumption(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName)...)
errs = append(errs, validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkAlpha()...)
return
}(fldPath.Child("counters"), obj.Counters, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceCounterConsumption) map[string]resourcev1beta2.Counter {
return oldObj.Counters
@ -987,7 +987,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1007,11 +1007,11 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1020,7 +1020,7 @@ func Validate_DeviceRequest(ctx context.Context, op operation.Operation, fldPath
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceSubRequest, b resourcev1beta2.DeviceSubRequest) bool {
return a.Name == b.Name
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.DeviceSubRequest, b resourcev1beta2.DeviceSubRequest) bool {
return a.Name == b.Name
@ -1047,15 +1047,15 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceRequestAllocationResult) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1068,14 +1068,14 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("pool"), &obj.Pool, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceRequestAllocationResult) *string { return &oldObj.Pool }), oldObj != nil)...)
@ -1091,7 +1091,7 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1113,11 +1113,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1135,11 +1135,11 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1159,13 +1159,13 @@ func Validate_DeviceRequestAllocationResult(ctx context.Context, op operation.Op
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.UUID(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("shareID"), obj.ShareID, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceRequestAllocationResult) *types.UID { return oldObj.ShareID }), oldObj != nil)...)
@ -1187,14 +1187,14 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("deviceClassName"), &obj.DeviceClassName, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceSubRequest) *string { return &oldObj.DeviceClassName }), oldObj != nil)...)
@ -1207,11 +1207,11 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1231,7 +1231,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1255,7 +1255,7 @@ func Validate_DeviceSubRequest(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1287,7 +1287,7 @@ func Validate_DeviceTaint(ctx context.Context, op operation.Operation, fldPath *
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1308,7 +1308,7 @@ var symbolsForDeviceTaintEffect = sets.New(resourcev1beta2.DeviceTaintEffectNoEx
// Validate_DeviceTaintEffect validates an instance of DeviceTaintEffect according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintEffect(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceTaintEffect) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil).MarkAlpha()...)
return errs
}
@ -1325,13 +1325,13 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.LabelKey(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("key"), &obj.Key, safe.Field(oldObj, func(oldObj *resourcev1beta2.DeviceToleration) *string { return &oldObj.Key }), oldObj != nil)...)
@ -1345,7 +1345,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
// call field-attached validations
earlyReturn := false
// optional fields with default values are effectively required
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1370,7 +1370,7 @@ func Validate_DeviceToleration(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1392,7 +1392,7 @@ var symbolsForDeviceTolerationOperator = sets.New(resourcev1beta2.DeviceTolerati
// Validate_DeviceTolerationOperator validates an instance of DeviceTolerationOperator according
// to declarative validation rules in the API schema.
func Validate_DeviceTolerationOperator(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1beta2.DeviceTolerationOperator) (errs field.ErrorList) {
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil)...)
errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil).MarkAlpha()...)
return errs
}
@ -1411,11 +1411,11 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1435,7 +1435,7 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1460,7 +1460,7 @@ func Validate_ExactDeviceRequest(ctx context.Context, op operation.Operation, fl
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1489,13 +1489,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha()...)
return
}(fldPath.Child("interfaceName"), &obj.InterfaceName, safe.Field(oldObj, func(oldObj *resourcev1beta2.NetworkDeviceData) *string { return &oldObj.InterfaceName }), oldObj != nil)...)
@ -1508,18 +1508,18 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with set semantics require unique values
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual)...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkAlpha()...)
return
}(fldPath.Child("ips"), obj.IPs, safe.Field(oldObj, func(oldObj *resourcev1beta2.NetworkDeviceData) []string { return oldObj.IPs }), oldObj != nil)...)
@ -1532,13 +1532,13 @@ func Validate_NetworkDeviceData(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 128).MarkAlpha()...)
return
}(fldPath.Child("hardwareAddress"), &obj.HardwareAddress, safe.Field(oldObj, func(oldObj *resourcev1beta2.NetworkDeviceData) *string { return &oldObj.HardwareAddress }), oldObj != nil)...)
@ -1557,15 +1557,15 @@ func Validate_OpaqueDeviceConfiguration(ctx context.Context, op operation.Operat
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
return
}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1beta2.OpaqueDeviceConfiguration) *string { return &oldObj.Driver }), oldObj != nil)...)
@ -1588,7 +1588,7 @@ func Validate_ResourceClaim(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1647,10 +1647,10 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify); len(e) != 0 {
if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -1673,11 +1673,11 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
@ -1686,7 +1686,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.ResourceClaimConsumerReference, b resourcev1beta2.ResourceClaimConsumerReference) bool {
return a.UID == b.UID
})...)
}).MarkAlpha()...)
return
}(fldPath.Child("reservedFor"), obj.ReservedFor, safe.Field(oldObj, func(oldObj *resourcev1beta2.ResourceClaimStatus) []resourcev1beta2.ResourceClaimConsumerReference {
return oldObj.ReservedFor
@ -1701,7 +1701,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1710,7 +1710,7 @@ func Validate_ResourceClaimStatus(ctx context.Context, op operation.Operation, f
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.AllocatedDeviceStatus, b resourcev1beta2.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
})...)
}).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.AllocatedDeviceStatus, b resourcev1beta2.AllocatedDeviceStatus) bool {
return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID))
@ -1807,7 +1807,7 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -1829,18 +1829,18 @@ func Validate_ResourceSliceSpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8); len(e) != 0 {
errs = append(errs, e...)
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// lists with map semantics require unique keys
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.CounterSet, b resourcev1beta2.CounterSet) bool { return a.Name == b.Name })...)
errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.CounterSet, b resourcev1beta2.CounterSet) bool { return a.Name == b.Name }).MarkAlpha()...)
// iterate the list and call the type's validation function
errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, func(a resourcev1beta2.CounterSet, b resourcev1beta2.CounterSet) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CounterSet)...)
return

View file

@ -74,11 +74,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -97,11 +97,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -119,11 +119,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -146,11 +146,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -178,7 +178,7 @@ func Validate_VolumeAttachment(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -206,15 +206,15 @@ func Validate_VolumeAttachmentSpec(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("attacher"), &obj.Attacher, safe.Field(oldObj, func(oldObj *storagev1.VolumeAttachmentSpec) *string { return &oldObj.Attacher }), oldObj != nil)...)

View file

@ -65,7 +65,7 @@ func Validate_VolumeAttachment(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -95,15 +95,15 @@ func Validate_VolumeAttachmentSpec(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("attacher"), &obj.Attacher, safe.Field(oldObj, func(oldObj *storagev1alpha1.VolumeAttachmentSpec) *string { return &oldObj.Attacher }), oldObj != nil)...)

View file

@ -74,11 +74,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -97,11 +97,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -119,11 +119,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -146,11 +146,11 @@ func Validate_StorageClass(ctx context.Context, op operation.Operation, fldPath
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -180,7 +180,7 @@ func Validate_VolumeAttachment(ctx context.Context, op operation.Operation, fldP
}
// call field-attached validations
earlyReturn := false
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -210,15 +210,15 @@ func Validate_VolumeAttachmentSpec(ctx context.Context, op operation.Operation,
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63)...)
errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkAlpha()...)
errs = append(errs, validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkAlpha()...)
return
}(fldPath.Child("attacher"), &obj.Attacher, safe.Field(oldObj, func(oldObj *storagev1beta1.VolumeAttachmentSpec) *string { return &oldObj.Attacher }), oldObj != nil)...)

View file

@ -54,13 +54,13 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"spec.policyName is required": {
input: mkValidBinding(tweakPolicyName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "policyName"), ""),
field.Required(field.NewPath("spec", "policyName"), "").MarkAlpha(),
},
},
"spec.validationActions is required": {
input: mkValidBinding(tweakValidateActions([]admissionregistration.ValidationAction{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "validationActions"), ""),
field.Required(field.NewPath("spec", "validationActions"), "").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -94,14 +94,14 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
oldObj: mkValidBinding(func(obj *admissionregistration.ValidatingAdmissionPolicyBinding) { obj.ResourceVersion = "1" }),
updateObj: mkValidBinding(tweakPolicyName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "policyName"), ""),
field.Required(field.NewPath("spec", "policyName"), "").MarkAlpha(),
},
},
"update with empty spec.validationActions": {
oldObj: mkValidBinding(),
updateObj: mkValidBinding(tweakValidateActions([]admissionregistration.ValidationAction{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "validationActions"), ""),
field.Required(field.NewPath("spec", "validationActions"), "").MarkAlpha(),
},
},
// TODO: Add more test cases

View file

@ -63,19 +63,19 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"invalid: maxReplicas = 0 (required)": {
input: makeValidHPA(tweakMaxReplicas(0)),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "maxReplicas"), ""),
field.Required(field.NewPath("spec", "maxReplicas"), "").MarkAlpha(),
},
},
"invalid: maxReplicas negative": {
input: makeValidHPA(tweakMaxReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "maxReplicas"), int32(-1), "must be greater than or equal to 1").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec", "maxReplicas"), int32(-1), "must be greater than or equal to 1").WithOrigin("minimum").MarkAlpha(),
},
},
"invalid: minReplicas = 0 (gate disabled)": {
input: makeValidHPA(tweakMinReplicas(0), tweakMetrics(validScaleToZeroMetrics...)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "minReplicas"), int32(0), "must be greater than or equal to 1").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec", "minReplicas"), int32(0), "must be greater than or equal to 1").WithOrigin("minimum").MarkAlpha(),
},
},
}
@ -119,21 +119,21 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
oldObj: makeValidHPA(),
updateObj: makeValidHPA(tweakMaxReplicas(0)),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "maxReplicas"), ""),
field.Required(field.NewPath("spec", "maxReplicas"), "").MarkAlpha(),
},
},
"invalid update: maxReplicas negative": {
oldObj: makeValidHPA(),
updateObj: makeValidHPA(tweakMaxReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "maxReplicas"), int32(-1), "must be greater than or equal to 1").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec", "maxReplicas"), int32(-1), "must be greater than or equal to 1").WithOrigin("minimum").MarkAlpha(),
},
},
"invalid update: minReplicas 1 -> 0 (gate disabled)": {
oldObj: makeValidHPA(tweakMinReplicas(1), tweakMetrics(validScaleToZeroMetrics...)),
updateObj: makeValidHPA(tweakMinReplicas(0), tweakMetrics(validScaleToZeroMetrics...)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "minReplicas"), int32(0), "must be greater than or equal to 1").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec", "minReplicas"), int32(0), "must be greater than or equal to 1").WithOrigin("minimum").MarkAlpha(),
},
},
"valid update: ratcheting minReplicas=0 when gate disabled": {

View file

@ -49,7 +49,7 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
"schedule: empty": {
input: mkCronJob(tweakSchedule("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "schedule"), ""),
field.Required(field.NewPath("spec", "schedule"), "").MarkAlpha(),
},
},
}
@ -85,7 +85,7 @@ func testValidateUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkCronJob(),
update: mkCronJob(tweakSchedule("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "schedule"), ""),
field.Required(field.NewPath("spec", "schedule"), "").MarkAlpha(),
},
},
}

View file

@ -78,13 +78,13 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
"status.conditions: Approved+Denied = invalid": {
input: makeValidCSR(withApprovedCondition(), withDeniedCondition()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf"),
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf").MarkAlpha(),
},
},
"status.conditions: Denied+Approved = invalid": {
input: makeValidCSR(withDeniedCondition(), withApprovedCondition()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf"),
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf").MarkAlpha(),
},
},
}
@ -154,7 +154,7 @@ func testValidateUpdateForDeclarative(t *testing.T, apiVersion string) {
old: makeValidCSR(),
update: makeValidCSR(withApprovedCondition(), withDeniedCondition()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf"),
field.Invalid(field.NewPath("status", "conditions"), nil, "").WithOrigin("zeroOrOneOf").MarkAlpha(),
},
subresources: []string{"/approval"}, // Can only add Approved and Denied conditions on /approval subresource
},

View file

@ -67,7 +67,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = "-this-is-not-a-label"
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: invalid subdomain format": {
@ -75,7 +75,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = ".this.is.not.a.subdomain"
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: label format with trailing dash": {
@ -83,7 +83,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = "this-is-a-label-"
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: subdomain format with trailing dash": {
@ -91,7 +91,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = "this.is.a.subdomain-"
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: long label format": {
@ -109,7 +109,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = strings.Repeat("x", 254)
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: too long subdomain format": {
@ -117,7 +117,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Name = strings.Repeat("x.", 126) + "xx"
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata.name"), nil, "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
// metadata.generateName (note: it's is not really validated)
@ -158,7 +158,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
rc.Spec.Replicas = nil
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec.replicas"), ""),
field.Required(field.NewPath("spec.replicas"), "").MarkAlpha(),
},
},
"replicas: 0": {
@ -170,7 +170,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
"replicas: negative": {
input: mkValidReplicationController(setSpecReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
// spec.minReadySeconds
@ -183,7 +183,7 @@ func TestDeclarativeValidateForDeclarative(t *testing.T) {
"minReadySeconds: negative": {
input: mkValidReplicationController(setSpecMinReadySeconds(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.minReadySeconds"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.minReadySeconds"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
}
@ -235,7 +235,7 @@ func TestValidateUpdateForDeclarative(t *testing.T) {
rc.Spec.Replicas = nil
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec.replicas"), ""),
field.Required(field.NewPath("spec.replicas"), "").MarkAlpha(),
},
},
"replicas: 0": {
@ -250,7 +250,7 @@ func TestValidateUpdateForDeclarative(t *testing.T) {
old: mkValidReplicationController(),
update: mkValidReplicationController(setSpecReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
// spec.minReadySeconds
@ -266,7 +266,7 @@ func TestValidateUpdateForDeclarative(t *testing.T) {
old: mkValidReplicationController(),
update: mkValidReplicationController(setSpecMinReadySeconds(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.minReadySeconds"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.minReadySeconds"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
}

View file

@ -49,7 +49,7 @@ func TestValidateScaleForDeclarative(t *testing.T) {
"spec.replicas: negative replicas": {
input: mkScale(setScaleSpecReplicas(-1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum"),
field.Invalid(field.NewPath("spec.replicas"), nil, "").WithOrigin("minimum").MarkAlpha(),
},
},
}

View file

@ -61,25 +61,25 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
obj.Endpoints[0].Addresses = nil
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("endpoints").Index(0).Child("addresses"), ""),
field.Required(field.NewPath("endpoints").Index(0).Child("addresses"), "").MarkAlpha(),
},
},
"invalid too many endpoint addresses": {
input: mkValidEndpointSlice(tweakAddresses(101)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("endpoints").Index(0).Child("addresses"), 101, 100).WithOrigin("maxItems"),
field.TooMany(field.NewPath("endpoints").Index(0).Child("addresses"), 101, 100).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid missing addressType": {
input: mkValidEndpointSlice(tweakAddressType("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("addressType"), ""),
field.Required(field.NewPath("addressType"), "").MarkAlpha(),
},
},
"invalid addressType not supported": {
input: mkValidEndpointSlice(tweakAddressType("invalid")),
expectedErrs: field.ErrorList{
field.NotSupported(field.NewPath("addressType"), discovery.AddressType("invalid"), []string{string(discovery.AddressTypeIPv4), string(discovery.AddressTypeIPv6), string(discovery.AddressTypeFQDN)}),
field.NotSupported(field.NewPath("addressType"), discovery.AddressType("invalid"), []string{string(discovery.AddressTypeIPv4), string(discovery.AddressTypeIPv6), string(discovery.AddressTypeFQDN)}).MarkAlpha(),
},
},
}
@ -118,21 +118,21 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
obj.Endpoints[0].Addresses = nil
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("endpoints").Index(0).Child("addresses"), ""),
field.Required(field.NewPath("endpoints").Index(0).Child("addresses"), "").MarkAlpha(),
},
},
"invalid update too many addresses": {
oldObj: mkValidEndpointSlice(),
updateObj: mkValidEndpointSlice(tweakAddresses(101)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("endpoints").Index(0).Child("addresses"), 101, 100).WithOrigin("maxItems"),
field.TooMany(field.NewPath("endpoints").Index(0).Child("addresses"), 101, 100).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid update addressType immutable": {
oldObj: mkValidEndpointSlice(),
updateObj: mkValidEndpointSlice(tweakAddressType(discovery.AddressTypeIPv6)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("addressType"), discovery.AddressTypeIPv6, "field is immutable").WithOrigin("immutable"),
field.Invalid(field.NewPath("addressType"), discovery.AddressTypeIPv6, "field is immutable").WithOrigin("immutable").MarkAlpha(),
},
},
}

View file

@ -59,14 +59,14 @@ func TestDeclarativeValidateParameter(t *testing.T) {
obj.Spec.Parameters.Name = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parameters", "name"), "")},
field.Required(field.NewPath("spec", "parameters", "name"), "").MarkAlpha()},
},
"missing parameter kind": {
input: mkValidIngressClass(func(obj *networking.IngressClass) {
obj.Spec.Parameters.Kind = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parameters", "kind"), ""),
field.Required(field.NewPath("spec", "parameters", "kind"), "").MarkAlpha(),
},
},
}
@ -119,7 +119,7 @@ func TestDeclarativeValidateUpdateParameters(t *testing.T) {
obj.Spec.Parameters.Name = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parameters", "name"), ""),
field.Required(field.NewPath("spec", "parameters", "name"), "").MarkAlpha(),
},
},
"update fails when parameters kind is cleared": {
@ -131,7 +131,7 @@ func TestDeclarativeValidateUpdateParameters(t *testing.T) {
obj.Spec.Parameters.Kind = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parameters", "kind"), ""),
field.Required(field.NewPath("spec", "parameters", "kind"), "").MarkAlpha(),
},
},
}

View file

@ -52,19 +52,19 @@ func TestDeclarativeValidateIPAddress(t *testing.T) {
"missing parentRef": {
input: mkValidIPAddress(withNilParentRef),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parentRef"), ""),
field.Required(field.NewPath("spec", "parentRef"), "").MarkAlpha(),
},
},
"missing parentRef resource": {
input: mkValidIPAddress(withEmptyParentRefResource),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parentRef", "resource"), ""),
field.Required(field.NewPath("spec", "parentRef", "resource"), "").MarkAlpha(),
},
},
"missing parentRef name": {
input: mkValidIPAddress(withEmptyParentRefName),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parentRef", "name"), ""),
field.Required(field.NewPath("spec", "parentRef", "name"), "").MarkAlpha(),
},
},
}
@ -110,7 +110,7 @@ func TestDeclarativeValidateIPAddressUpdate(t *testing.T) {
}, "field is immutable")
e.Origin = "immutable"
return e
}(),
}().MarkAlpha(),
},
},
"set parentRef": {
@ -128,7 +128,7 @@ func TestDeclarativeValidateIPAddressUpdate(t *testing.T) {
}, "field is immutable")
e.Origin = "immutable"
return e
}(),
}().MarkAlpha(),
},
},
"unset parentRef": {
@ -138,12 +138,12 @@ func TestDeclarativeValidateIPAddressUpdate(t *testing.T) {
withNilParentRef,
),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "parentRef"), ""),
field.Required(field.NewPath("spec", "parentRef"), "").MarkAlpha(),
func() *field.Error {
e := field.Invalid(field.NewPath("spec", "parentRef"), nil, "field is immutable")
e.Origin = "immutable"
return e
}(),
}().MarkAlpha(),
},
},
}

View file

@ -59,7 +59,7 @@ func TestDeclarativeValidateIPBlockCIDR(t *testing.T) {
field.Required(
field.NewPath("spec", "ingress").Index(0).Child("from").Index(0).Child("ipBlock", "cidr"),
"",
),
).MarkAlpha(),
},
},
"egress rule rejects empty CIDR in ipBlock": {
@ -68,7 +68,7 @@ func TestDeclarativeValidateIPBlockCIDR(t *testing.T) {
field.Required(
field.NewPath("spec", "egress").Index(0).Child("to").Index(0).Child("ipBlock", "cidr"),
"",
),
).MarkAlpha(),
},
},
}
@ -111,7 +111,7 @@ func TestDeclarativeValidateIPBlockCIDRUpdate(t *testing.T) {
field.Required(
field.NewPath("spec", "ingress").Index(0).Child("from").Index(0).Child("ipBlock", "cidr"),
"",
),
).MarkAlpha(),
},
},
@ -122,7 +122,7 @@ func TestDeclarativeValidateIPBlockCIDRUpdate(t *testing.T) {
field.Required(
field.NewPath("spec", "egress").Index(0).Child("to").Index(0).Child("ipBlock", "cidr"),
"",
),
).MarkAlpha(),
},
},
}

View file

@ -68,7 +68,7 @@ func TestRuntimeClass_DeclarativeValidate_Create(t *testing.T) {
rc.Handler = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("handler"), "must be a valid DNS label"),
field.Required(field.NewPath("handler"), "must be a valid DNS label").MarkAlpha(),
},
},
"handler with special characters": {
@ -77,7 +77,7 @@ func TestRuntimeClass_DeclarativeValidate_Create(t *testing.T) {
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("handler"),
"", "").WithOrigin("format=k8s-short-name"),
"", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"handler with uppercase and special characters": {
@ -86,7 +86,7 @@ func TestRuntimeClass_DeclarativeValidate_Create(t *testing.T) {
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("handler"),
"", "").WithOrigin("format=k8s-short-name"),
"", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"handler exceeds length with invalid characters": {
@ -95,7 +95,7 @@ func TestRuntimeClass_DeclarativeValidate_Create(t *testing.T) {
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("handler"),
"", "").WithOrigin("format=k8s-short-name"),
"", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
}
@ -139,7 +139,7 @@ func TestRuntimeClass_DeclarativeValidate_Update(t *testing.T) {
}),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("handler"), "",
"").WithOrigin("immutable"),
"").WithOrigin("immutable").MarkAlpha(),
},
},
}

View file

@ -49,13 +49,13 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
"invalid ClusterRole missing verbs": {
input: mkValidClusterRole(tweakVerbs(nil)),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
"invalid ClusterRole empty verbs": {
input: mkValidClusterRole(tweakVerbs([]string{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -91,7 +91,7 @@ func testValidateUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidClusterRole(),
update: mkValidClusterRole(tweakVerbs([]string{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
// TODO: Add more test cases

View file

@ -55,13 +55,13 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
"invalid Role missing verbs": {
input: mkValidRole(tweakVerbs(nil)),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
"invalid Role empty verbs": {
input: mkValidRole(tweakVerbs([]string{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -103,7 +103,7 @@ func testValidateUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidRole(),
update: mkValidRole(tweakVerbs([]string{})),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("rules").Index(0).Child("verbs"), ""),
field.Required(field.NewPath("rules").Index(0).Child("verbs"), "").MarkAlpha(),
},
},
// TODO: Add more test cases

View file

@ -59,7 +59,7 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
},
},
expectedErrs: field.ErrorList{
field.Required(field.NewPath("roleRef", "name"), "name is required"),
field.Required(field.NewPath("roleRef", "name"), "name is required").MarkAlpha(),
},
},
@ -76,7 +76,7 @@ func testDeclarativeValidateForDeclarative(t *testing.T, apiVersion string) {
},
},
expectedErrs: field.ErrorList{
field.Required(field.NewPath("subjects").Index(0).Child("name"), "name is required"),
field.Required(field.NewPath("subjects").Index(0).Child("name"), "name is required").MarkAlpha(),
},
},

View file

@ -64,13 +64,13 @@ func TestDeclarativeValidate(t *testing.T) {
"name: invalid (uppercase)": {
input: mkDeviceClass(tweakName("Invalid-Name")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata", "name"), "Invalid-Name", "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata", "name"), "Invalid-Name", "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: invalid (start with dash)": {
input: mkDeviceClass(tweakName("-invalid")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata", "name"), "-invalid", "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata", "name"), "-invalid", "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"name: max length": {
@ -79,7 +79,7 @@ func TestDeclarativeValidate(t *testing.T) {
"name: too long": {
input: mkDeviceClass(tweakName(strings.Repeat("a", 254))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("metadata", "name"), strings.Repeat("a", 254), "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("metadata", "name"), strings.Repeat("a", 254), "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
// spec.selectors.
@ -89,14 +89,14 @@ func TestDeclarativeValidate(t *testing.T) {
"too many selectors": {
input: mkDeviceClass(tweakSelectors(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "selectors"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "selectors"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.config
"too many configs": {
input: mkDeviceClass(tweakConfig(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "config"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "config"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid: at limit configs": {
@ -110,31 +110,31 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid extended resource name": {
input: mkDeviceClass(tweakExtendedResourceName("invalid_name")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "invalid_name", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "invalid_name", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name, no slash": {
input: mkDeviceClass(tweakExtendedResourceName("noslash")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "noslash", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "noslash", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name, kubernetes.io domain": {
input: mkDeviceClass(tweakExtendedResourceName("kubernetes.io/foo")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "kubernetes.io/foo", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "kubernetes.io/foo", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name, requests. prefix": {
input: mkDeviceClass(tweakExtendedResourceName("requests.example.com/foo")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "requests.example.com/foo", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "requests.example.com/foo", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name, too long": {
input: mkDeviceClass(tweakExtendedResourceName("example.com/" + strings.Repeat("a", 64))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "example.com/"+strings.Repeat("a", 64), "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "example.com/"+strings.Repeat("a", 64), "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -185,7 +185,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkDeviceClass(),
update: mkDeviceClass(tweakSelectors(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "selectors"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "selectors"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid update: at limit configs": {
@ -196,7 +196,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkDeviceClass(),
update: mkDeviceClass(tweakConfig(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "config"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "config"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
@ -209,35 +209,35 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkDeviceClass(),
update: mkDeviceClass(tweakExtendedResourceName("invalid_name")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "invalid_name", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "invalid_name", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name update, no slash": {
old: mkDeviceClass(),
update: mkDeviceClass(tweakExtendedResourceName("noslash")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "noslash", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "noslash", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name update, kubernetes.io domain": {
old: mkDeviceClass(),
update: mkDeviceClass(tweakExtendedResourceName("kubernetes.io/foo")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "kubernetes.io/foo", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "kubernetes.io/foo", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name update, requests. prefix": {
old: mkDeviceClass(),
update: mkDeviceClass(tweakExtendedResourceName("requests.example.com/foo")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "requests.example.com/foo", "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "requests.example.com/foo", "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
"invalid extended resource name update, too long": {
old: mkDeviceClass(),
update: mkDeviceClass(tweakExtendedResourceName("example.com/" + strings.Repeat("a", 64))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "extendedResourceName"), "example.com/"+strings.Repeat("a", 64), "").WithOrigin("format=k8s-extended-resource-name"),
field.Invalid(field.NewPath("spec", "extendedResourceName"), "example.com/"+strings.Repeat("a", 64), "").WithOrigin("format=k8s-extended-resource-name").MarkAlpha(),
},
},
// TODO: Add more test cases

View file

@ -82,82 +82,82 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"invalid requests, too many": {
input: mkValidResourceClaim(tweakDevicesRequests(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid requests, duplicate name": {
input: mkValidResourceClaim(tweakAddDeviceRequest(mkDeviceRequest("req-0"))),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec", "devices", "requests").Index(1), "req-0"),
field.Duplicate(field.NewPath("spec", "devices", "requests").Index(1), "req-0").MarkAlpha(),
},
},
"invalid requests, too many AND duplicate name (short-circuit check)": {
input: mkValidResourceClaim(tweakDevicesRequests(33), tweakAddDeviceRequest(mkDeviceRequest("req-0"))),
expectedErrs: field.ErrorList{
// We expect ONLY TooMany, suppressing the Duplicate error because of short-circuiting
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid constraints, too many": {
input: mkValidResourceClaim(tweakDevicesConstraints(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "constraints"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "constraints"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid config, too many": {
input: mkValidResourceClaim(tweakDevicesConfigs(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "config"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "config"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid firstAvailable, too many": {
input: mkValidResourceClaim(tweakFirstAvailable(9)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable"), 9, 8).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable"), 9, 8).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid firstAvailable, duplicate name": {
input: mkValidResourceClaim(tweakDuplicateFirstAvailableName("sub-0")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(1), "sub-0"),
field.Duplicate(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(1), "sub-0").MarkAlpha(),
},
},
"invalid selectors, too many": {
input: mkValidResourceClaim(tweakExactlySelectors(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "selectors"), 33, 32).WithOrigin("maxItems").MarkCoveredByDeclarative(),
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "selectors"), 33, 32).WithOrigin("maxItems").MarkCoveredByDeclarative().MarkAlpha(),
},
},
"invalid subrequest selectors, too many": {
input: mkValidResourceClaim(tweakSubRequestSelectors(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("selectors"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("selectors"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid constraint requests, too many": {
input: mkValidResourceClaim(tweakConstraintRequests(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
field.TooMany(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid config requests, too many": {
input: mkValidResourceClaim(tweakConfigRequests(33)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "config").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices", "requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
field.TooMany(field.NewPath("spec", "devices", "config").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid constraint requests, duplicate name": {
input: mkValidResourceClaim(tweakDuplicateConstraintRequest("req-0")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests").Index(1), "req-0"),
field.Duplicate(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests").Index(1), "req-0").MarkAlpha(),
},
},
"invalid config requests, duplicate name": {
input: mkValidResourceClaim(tweakDuplicateConfigRequest("req-0")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec", "devices", "config").Index(0).Child("requests").Index(1), "req-0"),
field.Duplicate(field.NewPath("spec", "devices", "config").Index(0).Child("requests").Index(1), "req-0").MarkAlpha(),
},
},
"valid firstAvailable, max allowed": {
@ -187,32 +187,32 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"invalid opaque driver, empty": {
input: mkValidResourceClaim(tweakDeviceConfigWithDriver("")),
expectedErrs: field.ErrorList{
field.Required(opaqueDriverPath, ""),
field.Required(opaqueDriverPath, "").MarkAlpha(),
},
},
"invalid opaque driver, too long - 64 characters": {
input: mkValidResourceClaim(tweakDeviceConfigWithDriver(strings.Repeat("a", 64))),
expectedErrs: field.ErrorList{
field.TooLong(opaqueDriverPath, "", 63).WithOrigin("maxLength"),
field.TooLong(opaqueDriverPath, "", 63).MarkAlpha().WithOrigin("maxLength").MarkAlpha(),
},
},
"invalid opaque driver, too long - 255 characters": {
input: mkValidResourceClaim(tweakDeviceConfigWithDriver(strings.Repeat("a", 255))),
expectedErrs: field.ErrorList{
field.TooLong(opaqueDriverPath, "", 63).WithOrigin("maxLength"),
field.Invalid(opaqueDriverPath, "", "").WithOrigin("format=k8s-long-name-caseless"),
field.TooLong(opaqueDriverPath, "", 63).WithOrigin("maxLength").MarkAlpha(),
field.Invalid(opaqueDriverPath, "", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
"invalid opaque driver, invalid character": {
input: mkValidResourceClaim(tweakDeviceConfigWithDriver("dra_example.com")),
expectedErrs: field.ErrorList{
field.Invalid(opaqueDriverPath, "dra_example.com", "").WithOrigin("format=k8s-long-name-caseless"),
field.Invalid(opaqueDriverPath, "dra_example.com", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
"invalid opaque driver, invalid DNS name (leading dot)": {
input: mkValidResourceClaim(tweakDeviceConfigWithDriver(".example.com")),
expectedErrs: field.ErrorList{
field.Invalid(opaqueDriverPath, ".example.com", "").WithOrigin("format=k8s-long-name-caseless"),
field.Invalid(opaqueDriverPath, ".example.com", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
// spec.Devices.Requests[%d].Exactly.Tolerations.Key
@ -231,7 +231,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
{Key: "invalid_key!", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("key"), "invalid_key!", "").WithOrigin("format=k8s-label-key"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("key"), "invalid_key!", "").WithOrigin("format=k8s-label-key").MarkAlpha(),
},
},
"invalid Exactly.Tolerations.Key - multiple slashes": {
@ -239,7 +239,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
{Key: "a/b/c", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("key"), "a/b/c", "").WithOrigin("format=k8s-label-key"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("key"), "a/b/c", "").WithOrigin("format=k8s-label-key").MarkAlpha(),
},
},
// spec.Devices.Requests[%d].FirsAvailable[%d].Tolerations.Key
@ -258,7 +258,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
{Key: "invalid_key!", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("key"), "invalid_key!", "").WithOrigin("format=k8s-label-key"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("key"), "invalid_key!", "").WithOrigin("format=k8s-label-key").MarkAlpha(),
},
},
"invalid FirstAvailable.Tolerations.Key - multiple slashes": {
@ -266,7 +266,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
{Key: "a/b/c", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("key"), "a/b/c", "").WithOrigin("format=k8s-label-key"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("key"), "a/b/c", "").WithOrigin("format=k8s-label-key").MarkAlpha(),
},
},
"valid DeviceAllocationMode - All": {
@ -279,7 +279,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "allocationMode"),
resource.DeviceAllocationMode("InvalidMode"),
[]string{"All", "ExactCount"},
),
).MarkAlpha(),
},
},
"valid DeviceAllocationMode - FirstAvailable": {
@ -292,7 +292,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("allocationMode"),
resource.DeviceAllocationMode("InvalidMode"),
[]string{"All", "ExactCount"},
),
).MarkAlpha(),
},
},
// spec.devices.requests[%d].firstAvailable[%d].deviceClassName
@ -303,19 +303,19 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"invalid firstAvailable class name - invalid characters": {
input: mkValidResourceClaim(tweakFirstAvailableDeviceClassName("Class&")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), "Class&", "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), "Class&", "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"invalid firstAvailable class name - long name": {
input: mkValidResourceClaim(tweakFirstAvailableDeviceClassName(strings.Repeat("a", 254))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), "Class&", "").WithOrigin("format=k8s-long-name"),
field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), "Class&", "").WithOrigin("format=k8s-long-name").MarkAlpha(),
},
},
"invalid firstAvailable class name - empty": {
input: mkValidResourceClaim(tweakFirstAvailableDeviceClassName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), ""),
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("deviceClassName"), "").MarkAlpha(),
},
},
"valid DeviceTolerationOperator/Effect - Exactly": {
@ -333,7 +333,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakExactlyTolerations([]resource.DeviceToleration{{Key: "key", Value: "value", Effect: resource.DeviceTaintEffectNoSchedule, Operator: ""}}),
),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("operator"), ""),
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("operator"), "").MarkAlpha(),
},
},
"invalid DeviceTolerationOperator - Exactly": {
@ -350,7 +350,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("operator"),
resource.DeviceTolerationOperator("InvalidOp"),
[]string{"Equal", "Exists"},
),
).MarkAlpha(),
},
},
"invalid DeviceTaintEffect - Exactly": {
@ -367,7 +367,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("exactly", "tolerations").Index(0).Child("effect"),
resource.DeviceTaintEffect("InvalidEffect"),
[]string{"NoExecute", "NoSchedule"},
),
).MarkAlpha(),
},
},
"valid DeviceTolerationOperator/Effect - FirstAvailable": {
@ -386,7 +386,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakFirstAvailableTolerations([]resource.DeviceToleration{{Key: "key", Value: "value", Effect: resource.DeviceTaintEffectNoSchedule, Operator: ""}}),
),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("operator"), ""),
field.Required(field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("operator"), "").MarkAlpha(),
},
},
"invalid DeviceTolerationOperator - FirstAvailable": {
@ -403,7 +403,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("operator"),
resource.DeviceTolerationOperator("InvalidOp"),
[]string{"Equal", "Exists"},
),
).MarkAlpha(),
},
},
"invalid DeviceTaintEffect - FirstAvailable": {
@ -420,7 +420,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
field.NewPath("spec", "devices", "requests").Index(0).Child("firstAvailable").Index(0).Child("tolerations").Index(0).Child("effect"),
resource.DeviceTaintEffect("InvalidEffect"),
[]string{"NoExecute", "NoSchedule"},
),
).MarkAlpha(),
},
},
// Spec.Devices.Constraints[%d].MatchAttribute
@ -429,7 +429,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("invalid!"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid!", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid!", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute without domain": {
@ -437,7 +437,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("nodomain"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "nodomain", "a fully qualified name must be a domain and a name separated by a slash").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "nodomain", "a fully qualified name must be a domain and a name separated by a slash").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute empty": {
@ -445,7 +445,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute(""),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with empty domain": {
@ -453,7 +453,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("/foo"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with empty name": {
@ -461,7 +461,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("foo/"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with invalid domain": {
@ -469,7 +469,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("invalid_domain/foo"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid_domain", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid_domain", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with invalid name": {
@ -477,7 +477,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("domain/invalid-name"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid-name", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "invalid-name", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with long name": {
@ -485,7 +485,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute("domain/" + strings.Repeat("a", 65)),
),
expectedErrs: field.ErrorList{
field.TooLong(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", 64).WithOrigin("format=k8s-resource-fully-qualified-name"),
field.TooLong(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", 64).WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
"match attribute with long domain": {
@ -493,8 +493,8 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
tweakMatchAttribute(strings.Repeat("a", 254) + "/name"),
),
expectedErrs: field.ErrorList{
field.TooLong(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", 63).WithOrigin("format=k8s-resource-fully-qualified-name"),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name"),
field.TooLong(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", 63).WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("matchAttribute"), "", "").WithOrigin("format=k8s-resource-fully-qualified-name").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -734,35 +734,35 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
update: mkValidResourceClaim(tweakSpecChangeClassName("another-class")),
old: validClaim,
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: add request": {
update: mkValidResourceClaim(tweakAddDeviceRequest(mkDeviceRequest("req-1"))),
old: validClaim,
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: remove request": {
update: mkValidResourceClaim(tweakSpecRemoveRequest(0)),
old: validClaim,
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: add constraint": {
update: mkValidResourceClaim(tweakSpecAddConstraint(mkDeviceConstraint())),
old: validClaim,
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: short-circuits other errors (e.g. TooMany)": {
update: mkValidResourceClaim(tweakDevicesRequests(33)),
old: mkValidResourceClaim(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: add Exactly.Tolerations": {
@ -771,7 +771,7 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
})),
old: validClaim,
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: change Exactly.Tolerations.Key": {
@ -782,7 +782,7 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
{Key: "valid-key", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
// spec.Devices.Requests[%d].FirsAvailable[%d].Tolerations.Key
@ -792,7 +792,7 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
})),
old: mkValidResourceClaim(tweakFirstAvailable(1)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: change FirstAvailable.Tolerations.Key": {
@ -803,14 +803,14 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
{Key: "valid-key", Operator: resource.DeviceTolerationOpExists, Effect: resource.DeviceTaintEffectNoSchedule},
})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
"spec immutable: short-circuits deviceClassName error": {
update: mkValidResourceClaim(tweakFirstAvailableDeviceClassName("Class")),
old: mkValidResourceClaim(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), "field is immutable", "").WithOrigin("immutable").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -870,36 +870,28 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultDriver("")),
expectedErrs: field.ErrorList{
field.Required(driverPath, ""),
field.Required(driverPath, "").MarkAlpha(),
},
},
"invalid driver name, too long - 64 characters": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultDriver(strings.Repeat("a", 64))),
expectedErrs: field.ErrorList{
field.TooLong(driverPath, "", 63).WithOrigin("maxLength"),
},
},
"invalid driver name, too long - 255 characters": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultDriver(strings.Repeat("a", 255))),
expectedErrs: field.ErrorList{
field.TooLong(driverPath, "", 63).WithOrigin("maxLength"),
field.Invalid(driverPath, "", "").WithOrigin("format=k8s-long-name-caseless"),
field.TooLong(driverPath, "", 63).MarkAlpha().WithOrigin("maxLength"),
},
},
"invalid driver name, invalid character": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultDriver("dra_example.com")),
expectedErrs: field.ErrorList{
field.Invalid(driverPath, "dra_example.com", "").WithOrigin("format=k8s-long-name-caseless"),
field.Invalid(driverPath, "dra_example.com", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
"invalid driver name, invalid DNS name (leading dot)": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultDriver(".example.com")),
expectedErrs: field.ErrorList{
field.Invalid(driverPath, ".example.com", "").WithOrigin("format=k8s-long-name-caseless"),
field.Invalid(driverPath, ".example.com", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
// .Status.Allocation.Devices.Results[%d].Pool
@ -915,42 +907,42 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool("")),
expectedErrs: field.ErrorList{
field.Required(poolPath, ""),
field.Required(poolPath, "").MarkAlpha(),
},
},
"invalid pool name, too long": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool(strings.Repeat("a", 253) + "/" + strings.Repeat("a", 253))),
expectedErrs: field.ErrorList{
field.TooLong(poolPath, "", 253).WithOrigin("format=k8s-resource-pool-name"),
field.TooLong(poolPath, "", 253).WithOrigin("format=k8s-resource-pool-name").MarkAlpha(),
},
},
"invalid pool name, format": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool("a/Not_Valid")),
expectedErrs: field.ErrorList{
field.Invalid(poolPath, "Not_Valid", "").WithOrigin("format=k8s-resource-pool-name"),
field.Invalid(poolPath, "Not_Valid", "").WithOrigin("format=k8s-resource-pool-name").MarkAlpha(),
},
},
"invalid pool name, leading slash": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool("/a")),
expectedErrs: field.ErrorList{
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name"),
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name").MarkAlpha(),
},
},
"invalid pool name, trailing slash": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool("a/")),
expectedErrs: field.ErrorList{
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name"),
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name").MarkAlpha(),
},
},
"invalid pool name, double slash": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultPool("a//b")),
expectedErrs: field.ErrorList{
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name"),
field.Invalid(poolPath, "", "").WithOrigin("format=k8s-resource-pool-name").MarkAlpha(),
},
},
// .Status.Allocation.Devices.Results[%d].ShareID
@ -962,14 +954,14 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultShareID("invalid-uid")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "").WithOrigin("format=k8s-uuid").MarkAlpha(),
},
},
"invalid uppercase status.Allocation.Devices.Results[].ShareID ": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusDeviceRequestAllocationResultShareID("123e4567-E89b-12d3-A456-426614174000")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "").WithOrigin("format=k8s-uuid").MarkAlpha(),
},
},
// .Status.Devices[%d].ShareID
@ -989,8 +981,8 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusAllocatedDeviceStatusShareID("invalid-uid"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "devices").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid").MarkAlpha(),
field.Invalid(field.NewPath("status", "devices").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid").MarkAlpha(),
},
},
"invalid upper case status.Devices[].ShareID": {
@ -1001,8 +993,8 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusAllocatedDeviceStatusShareID("123e4567-E89b-12d3-A456-426614174000"),
),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "devices").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid"),
field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid").MarkAlpha(),
field.Invalid(field.NewPath("status", "devices").Index(0).Child("shareID"), "invalid-uid", "must be a lowercase UUID in 8-4-4-4-12 format").WithOrigin("format=k8s-uuid").MarkAlpha(),
},
},
// UID in status.ReservedFor
@ -1015,7 +1007,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
resourceClaimReference(validUUID),
)),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "reservedFor").Index(2), ""),
field.Duplicate(field.NewPath("status", "reservedFor").Index(2), "").MarkAlpha(),
},
},
"multiple- duplicate uid in status.ReservedFor": {
@ -1029,8 +1021,8 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
resourceClaimReference(uuid.New().String()),
)),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "reservedFor").Index(2), ""),
field.Duplicate(field.NewPath("status", "reservedFor").Index(4), ""),
field.Duplicate(field.NewPath("status", "reservedFor").Index(2), "").MarkAlpha(),
field.Duplicate(field.NewPath("status", "reservedFor").Index(4), "").MarkAlpha(),
},
},
"invalid status.ReservedFor, too many": {
@ -1039,7 +1031,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusReservedFor(generateResourceClaimReferences(257)...),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "reservedFor"), 257, 256).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "reservedFor"), 257, 256).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid status.ReservedFor, max items": {
@ -1070,35 +1062,35 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkResourceClaimWithStatus(),
update: tweakStatusAllocationDevice(mkResourceClaimWithStatus(), "device-different"),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update"),
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update").MarkAlpha(),
},
},
"invalid status.allocation changed driver (NoModify)": {
old: mkResourceClaimWithStatus(),
update: tweakStatusAllocationDriver(mkResourceClaimWithStatus(), "different.example.com"),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update"),
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update").MarkAlpha(),
},
},
"invalid status.allocation changed pool (NoModify)": {
old: mkResourceClaimWithStatus(),
update: tweakStatusAllocationPool(mkResourceClaimWithStatus(), "different-pool"),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update"),
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update").MarkAlpha(),
},
},
"invalid status.allocation added result (NoModify)": {
old: mkResourceClaimWithStatus(),
update: addStatusAllocationResult(mkResourceClaimWithStatus()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update"),
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update").MarkAlpha(),
},
},
"invalid status.allocation removed result (NoModify)": {
old: addStatusAllocationResult(mkResourceClaimWithStatus()),
update: mkResourceClaimWithStatus(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update"),
field.Invalid(field.NewPath("status", "allocation"), nil, "field is immutable").WithOrigin("update").MarkAlpha(),
},
},
"invalid status.allocation.devices.results, too many": {
@ -1107,7 +1099,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusAllocationDevicesResults(33),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "allocation", "devices", "results"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "allocation", "devices", "results"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid status.allocation.devices.config, max items": {
@ -1122,7 +1114,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusAllocationDevicesConfig(65),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "allocation", "devices", "config"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "allocation", "devices", "config"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid status.allocation.devices.config requests, duplicate": {
@ -1131,7 +1123,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakAddStatusAllocationConfigRequest("req-0"),
),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests").Index(1), "req-0"),
field.Duplicate(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests").Index(1), "req-0").MarkAlpha(),
},
},
// .Status.Allocation.Devices.Config[%d].Source
@ -1147,14 +1139,14 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusAllocationConfigSource("")),
expectedErrs: field.ErrorList{
field.Required(configSourcePath, "").MarkCoveredByDeclarative(),
field.Required(configSourcePath, "").MarkCoveredByDeclarative().MarkAlpha(),
},
},
"invalid status.allocation.devices.config source invalid": {
old: mkValidResourceClaim(),
update: mkResourceClaimWithStatus(tweakStatusAllocationConfigSource("invalid")),
expectedErrs: field.ErrorList{
field.NotSupported(configSourcePath, resource.AllocationConfigSource("invalid"), []string{string(resource.AllocationConfigSourceClaim), string(resource.AllocationConfigSourceClass)}).MarkCoveredByDeclarative(),
field.NotSupported(configSourcePath, resource.AllocationConfigSource("invalid"), []string{string(resource.AllocationConfigSourceClaim), string(resource.AllocationConfigSourceClass)}).MarkCoveredByDeclarative().MarkAlpha(),
},
},
// .Status.Devices
@ -1196,7 +1188,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
),
),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "devices").Index(1), "driver1/pool1/device1"),
field.Duplicate(field.NewPath("status", "devices").Index(1), "driver1/pool1/device1").MarkAlpha(),
},
},
"invalid devices, duplicate with share ID": {
@ -1211,7 +1203,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
),
),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "devices").Index(1), "driver1/pool1/device1"),
field.Duplicate(field.NewPath("status", "devices").Index(1), "driver1/pool1/device1").MarkAlpha(),
},
},
// .Status.Allocation.Devices.Results[%d].BindingConditions
@ -1229,7 +1221,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusBindingFailureConditions(1),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid binding failure conditions, max items": {
@ -1246,7 +1238,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusBindingFailureConditions(resource.BindingFailureConditionsMaxSize+1),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
// .Status.Devices[%d].NetworkData.InterfaceName
@ -1280,7 +1272,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
),
),
expectedErrs: field.ErrorList{
field.TooLong(field.NewPath("status", "devices").Index(0).Child("networkData", "interfaceName"), "", resource.NetworkDeviceDataInterfaceNameMaxLength).MarkCoveredByDeclarative().WithOrigin("maxLength"),
field.TooLong(field.NewPath("status", "devices").Index(0).Child("networkData", "interfaceName"), "", resource.NetworkDeviceDataInterfaceNameMaxLength).MarkCoveredByDeclarative().WithOrigin("maxLength").MarkAlpha(),
},
},
"valid status.devices.networkData.hardwareAddress": {
@ -1313,7 +1305,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
),
),
expectedErrs: field.ErrorList{
field.TooLong(field.NewPath("status", "devices").Index(0).Child("networkData", "hardwareAddress"), "", resource.NetworkDeviceDataHardwareAddressMaxLength).MarkCoveredByDeclarative().WithOrigin("maxLength"),
field.TooLong(field.NewPath("status", "devices").Index(0).Child("networkData", "hardwareAddress"), "", resource.NetworkDeviceDataHardwareAddressMaxLength).MarkCoveredByDeclarative().WithOrigin("maxLength").MarkAlpha(),
},
},
"invalid status.devices.networkData.ips duplicate": {
@ -1331,7 +1323,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
),
),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("status", "devices").Index(0).Child("networkData", "ips").Index(1), "1.2.3.4/32"),
field.Duplicate(field.NewPath("status", "devices").Index(0).Child("networkData", "ips").Index(1), "1.2.3.4/32").MarkAlpha(),
},
},
"invalid status.allocation.devices.config.requests too many": {
@ -1340,7 +1332,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusAllocationConfigRequests(33),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests"), 33, 32).WithOrigin("maxItems").MarkAlpha(),
},
},
"valid status.allocation.devices.config.requests, max allowed": {
@ -1355,7 +1347,7 @@ func testValidateStatusUpdateForDeclarative(t *testing.T, apiVersion string) {
tweakStatusDevicesTooManyIPs(17),
),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("status", "devices").Index(0).Child("networkData", "ips"), 17, 16).WithOrigin("maxItems"),
field.TooMany(field.NewPath("status", "devices").Index(0).Child("networkData", "ips"), 17, 16).WithOrigin("maxItems").MarkAlpha(),
},
},
"invalid status.devices.networkData.ips, max allowed": {

View file

@ -60,7 +60,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: too many binding conditions": {
input: mkResourceSliceWithDevices(tweakBindingConditions(resource.BindingConditionsMaxSize + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.devices[%d].bindingFailureConditions
@ -73,7 +73,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: too many binding failure conditions": {
input: mkResourceSliceWithDevices(tweakBindingFailureConditions(resource.BindingFailureConditionsMaxSize + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.Devices[%d].Taints[%d].Effect
@ -88,13 +88,13 @@ func TestDeclarativeValidate(t *testing.T) {
expectedErrs: field.ErrorList{
field.NotSupported(
field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"),
resource.DeviceTaintEffect("Invalid"), []string{}),
resource.DeviceTaintEffect("Invalid"), []string{}).MarkAlpha(),
},
},
"invalid: taint empty": {
input: mkResourceSliceWithDevices(tweakDeviceTaintEffect("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), ""),
field.Required(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), "").MarkAlpha(),
},
},
// spec.Devices[%].attribute
@ -113,13 +113,13 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: device attribute with multiple values": {
input: mkResourceSliceWithDevices(tweakDeviceAttribute("test.io/multiple", resource.DeviceAttribute{IntValue: ptr.To[int64](123), BoolValue: ptr.To(true)})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union").MarkAlpha(),
},
},
"invalid: device attribute no value": {
input: mkResourceSliceWithDevices(tweakDeviceAttribute("test.io/multiple", resource.DeviceAttribute{})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union").MarkAlpha(),
},
},
// spec.sharedCounters
@ -129,7 +129,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: too many shared counters": {
input: mkResourceSliceWithSharedCounters(tweakSharedCounters(resource.ResourceSliceMaxCounterSets + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec").Child("sharedCounters"), resource.ResourceSliceMaxCounterSets+1, resource.ResourceSliceMaxCounterSets).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec").Child("sharedCounters"), resource.ResourceSliceMaxCounterSets+1, resource.ResourceSliceMaxCounterSets).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.devices.consumesCounters
@ -139,7 +139,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: too many device consumes counters": {
input: mkResourceSliceWithDevices(tweakDeviceConsumesCounters(resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("consumesCounters"), resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice+1, resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("consumesCounters"), resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice+1, resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.sharedCounters.name
@ -149,13 +149,13 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: counter set name": {
input: mkResourceSliceWithSharedCounters(tweakSharedCountersName("InvalidKey")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"invalid: counter set name not set": {
input: mkResourceSliceWithSharedCounters(tweakSharedCountersName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), ""),
field.Required(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "").MarkAlpha(),
},
},
// spec.devices.consumesCounters.counterSet
@ -165,13 +165,13 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: device consumes counters counter set name": {
input: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("InvalidKey")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"invalid: device consumes counters counter set name not set": {
input: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), ""),
field.Required(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "").MarkAlpha(),
},
},
// spec.sharedCounters
@ -181,7 +181,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: duplicate names for shared counters": {
input: mkResourceSliceWithSharedCounters(tweakSharedCountersName("duplicate-key", "duplicate-key")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec").Child("sharedCounters").Index(1), "duplicate-key"),
field.Duplicate(field.NewPath("spec").Child("sharedCounters").Index(1), "duplicate-key").MarkAlpha(),
},
},
// spec.devices.consumesCounters
@ -191,14 +191,14 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: duplicate names for counter set in device counter consumption": {
input: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("duplicate-key", "duplicate-key")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec").Child("devices").Index(0).Child("consumesCounters").Index(1), "duplicate-key"),
field.Duplicate(field.NewPath("spec").Child("devices").Index(0).Child("consumesCounters").Index(1), "duplicate-key").MarkAlpha(),
},
},
// spec.sharedCounters.counters
"invalid: shared counter key with uppercase": {
input: mkResourceSliceWithSharedCounters(tweakSharedCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"valid: shared counter key": {
@ -208,7 +208,7 @@ func TestDeclarativeValidate(t *testing.T) {
"invalid: device counter key with uppercase": {
input: mkResourceSliceWithDevices(tweakDeviceCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"valid: device counter key": {
@ -255,7 +255,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakBindingConditions(resource.BindingConditionsMaxSize + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingConditions"), resource.BindingConditionsMaxSize+1, resource.BindingConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.devices[%d].bindingFailureConditions
@ -267,7 +267,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakBindingFailureConditions(resource.BindingFailureConditionsMaxSize + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("bindingFailureConditions"), resource.BindingFailureConditionsMaxSize+1, resource.BindingFailureConditionsMaxSize).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.devices.taints.effect
@ -283,14 +283,14 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceTaintEffect("InvalidEffect")),
expectedErrs: field.ErrorList{
field.NotSupported(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), "InvalidEffect", []string{string(resource.DeviceTaintEffectNoSchedule), string(resource.DeviceTaintEffectNoExecute)}),
field.NotSupported(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), "InvalidEffect", []string{string(resource.DeviceTaintEffectNoSchedule), string(resource.DeviceTaintEffectNoExecute)}).MarkAlpha(),
},
},
"invalid update: empty taint effect": {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceTaintEffect("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), ""),
field.Required(field.NewPath("spec", "devices").Index(0).Child("taints").Index(0).Child("effect"), "").MarkAlpha(),
},
},
"valid update: device attribute": {
@ -301,7 +301,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceAttribute("test.io/multiple", resource.DeviceAttribute{IntValue: ptr.To[int64](123), BoolValue: ptr.To(true)})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union").MarkAlpha(),
},
},
// spec.sharedCounters
@ -313,7 +313,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithSharedCounters(),
update: mkResourceSliceWithSharedCounters(tweakSharedCounters(resource.ResourceSliceMaxCounterSets + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec").Child("sharedCounters"), resource.ResourceSliceMaxCounterSets+1, resource.ResourceSliceMaxCounterSets).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec").Child("sharedCounters"), resource.ResourceSliceMaxCounterSets+1, resource.ResourceSliceMaxCounterSets).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.devices.consumesCounters
@ -325,7 +325,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceConsumesCounters(resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice + 1)),
expectedErrs: field.ErrorList{
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("consumesCounters"), resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice+1, resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice).WithOrigin("maxItems"),
field.TooMany(field.NewPath("spec", "devices").Index(0).Child("consumesCounters"), resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice+1, resource.ResourceSliceMaxDeviceCounterConsumptionsPerDevice).WithOrigin("maxItems").MarkAlpha(),
},
},
// spec.sharedCounters.name
@ -337,14 +337,14 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithSharedCounters(),
update: mkResourceSliceWithSharedCounters(tweakSharedCountersName("InvalidKey")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"invalid update: counter set name not set": {
old: mkResourceSliceWithSharedCounters(),
update: mkResourceSliceWithSharedCounters(tweakSharedCountersName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), ""),
field.Required(field.NewPath("spec", "sharedCounters").Index(0).Child("name"), "").MarkAlpha(),
},
},
// spec.devices.consumesCounters.counterSet
@ -356,14 +356,14 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("InvalidKey")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
"invalidupdate: device consumes counters counter set name not set": {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), ""),
field.Required(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counterSet"), "").MarkAlpha(),
},
},
// spec.sharedCounters
@ -375,7 +375,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithSharedCounters(),
update: mkResourceSliceWithSharedCounters(tweakSharedCountersName("duplicate-key", "duplicate-key")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec").Child("sharedCounters").Index(1), "duplicate-key"),
field.Duplicate(field.NewPath("spec").Child("sharedCounters").Index(1), "duplicate-key").MarkAlpha(),
},
},
// spec.devices.consumesCounters
@ -387,7 +387,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceConsumesCountersCounterSetName("duplicate-key", "duplicate-key")),
expectedErrs: field.ErrorList{
field.Duplicate(field.NewPath("spec").Child("devices").Index(0).Child("consumesCounters").Index(1), "duplicate-key"),
field.Duplicate(field.NewPath("spec").Child("devices").Index(0).Child("consumesCounters").Index(1), "duplicate-key").MarkAlpha(),
},
},
// spec.sharedCounters.counters
@ -395,7 +395,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithSharedCounters(),
update: mkResourceSliceWithSharedCounters(tweakSharedCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
// spec.sharedCounters.counters: nil -> invalid
@ -403,7 +403,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithSharedCounters(tweakSharedCounter(nil)),
update: mkResourceSliceWithSharedCounters(tweakSharedCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "sharedCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
// spec.devices.consumesCounters.counters
@ -411,7 +411,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(),
update: mkResourceSliceWithDevices(tweakDeviceCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
// spec.devices.consumesCounters.counters: nil -> invalid
@ -419,7 +419,7 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
old: mkResourceSliceWithDevices(tweakDeviceCounter(nil)),
update: mkResourceSliceWithDevices(tweakDeviceCounter(counters("InvalidKey"))),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name"),
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("consumesCounters").Index(0).Child("counters"), "InvalidKey", "").WithOrigin("format=k8s-short-name").MarkAlpha(),
},
},
}

View file

@ -58,7 +58,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
obj.Provisioner = ""
}),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("provisioner"), ""),
field.Required(field.NewPath("provisioner"), "").MarkAlpha(),
},
},
// TODO: Add more test cases
@ -92,86 +92,86 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakProvisioner("kubernetes.io/aws-ebs")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update provisioner unset to set": {
oldObj: mkValidStorageClass(TweakProvisioner("")),
updateObj: mkValidStorageClass(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable"),
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update provisioner set to unset": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakProvisioner("")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable"),
field.Required(field.NewPath("provisioner"), ""),
field.Invalid(field.NewPath("provisioner"), "", "").WithOrigin("immutable").MarkAlpha(),
field.Required(field.NewPath("provisioner"), "").MarkAlpha(),
},
},
"invalid update parameters changed": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakParameters(map[string]string{"new": "value"})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update parameters unset to set": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakParameters(map[string]string{"foo": "bar"})),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update parameters set to unset": {
oldObj: mkValidStorageClass(TweakParameters(map[string]string{"foo": "bar"})),
updateObj: mkValidStorageClass(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("parameters"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update reclaimPolicy changed": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakReclaimPolicy(api.PersistentVolumeReclaimRetain)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update reclaimPolicy unset to set": {
oldObj: mkValidStorageClass(TweakReclaimPolicyNil()),
updateObj: mkValidStorageClass(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update reclaimPolicy set to unset": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakReclaimPolicyNil()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("reclaimPolicy"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update volumeBindingMode changed": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakVolumeBindingMode(storage.VolumeBindingWaitForFirstConsumer)),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update volumeBindingMode unset to set": {
oldObj: mkValidStorageClass(TweakVolumeBindingModeNil()),
updateObj: mkValidStorageClass(),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable"),
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
"invalid update volumeBindingMode set to unset": {
oldObj: mkValidStorageClass(),
updateObj: mkValidStorageClass(TweakVolumeBindingModeNil()),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable"),
field.Required(field.NewPath("volumeBindingMode"), "").MarkFromImperative(),
field.Invalid(field.NewPath("volumeBindingMode"), nil, "").WithOrigin("immutable").MarkAlpha(),
},
},
}

View file

@ -70,19 +70,19 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
"invalid attacher (required)": {
input: mkValidVolumeAttachment(TweakAttacher("")),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "attacher"), ""),
field.Required(field.NewPath("spec", "attacher"), "").MarkAlpha(),
},
},
"attacher with special characters": {
input: mkValidVolumeAttachment(TweakAttacher("asdadasd&@!")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec", "attacher"), "", "").WithOrigin("format=k8s-long-name-caseless"),
field.Invalid(field.NewPath("spec", "attacher"), "", "").WithOrigin("format=k8s-long-name-caseless").MarkAlpha(),
},
},
"attacher with number of characters exceeds 63": {
input: mkValidVolumeAttachment(TweakAttacher(strings.Repeat("a", 64))),
expectedErrs: field.ErrorList{
field.TooLong(field.NewPath("spec", "attacher"), strings.Repeat("a", 64), 63).WithOrigin("maxLength"),
field.TooLong(field.NewPath("spec", "attacher"), strings.Repeat("a", 64), 63).WithOrigin("maxLength").MarkAlpha(),
},
},
}
@ -116,7 +116,7 @@ func testDeclarativeValidateUpdate(t *testing.T, apiVersion string) {
oldInput: mkValidVolumeAttachment(),
newInput: mkValidVolumeAttachment(TweakAttacher("different.com")),
expectedErrs: field.ErrorList{
field.Invalid(field.NewPath("spec"), nil, "field is immutable").WithOrigin("immutable"),
field.Invalid(field.NewPath("spec"), nil, "field is immutable").WithOrigin("immutable").MarkAlpha(),
},
},
}

View file

@ -926,7 +926,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string policyName = 1;
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -985,7 +985,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string validationActions = 4;
}

View file

@ -476,7 +476,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"`
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -535,7 +535,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"`
}

View file

@ -648,7 +648,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string policyName = 1;
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -707,7 +707,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string validationActions = 4;
}

View file

@ -416,7 +416,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"`
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -475,7 +475,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"`
}

View file

@ -874,7 +874,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string policyName = 1;
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -933,7 +933,7 @@ message ValidatingAdmissionPolicyBindingSpec {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string validationActions = 4;
}

View file

@ -429,7 +429,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"`
// paramRef specifies the parameter resource used to configure the admission control policy.
@ -488,7 +488,7 @@ type ValidatingAdmissionPolicyBindingSpec struct {
// Required.
// +listType=set
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"`
}

View file

@ -318,9 +318,9 @@ message Scale {
message ScaleSpec {
// replicas is the number of observed instances of the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 replicas = 1;
}

View file

@ -33,9 +33,9 @@ const (
type ScaleSpec struct {
// replicas is the number of observed instances of the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}

View file

@ -616,9 +616,9 @@ message Scale {
message ScaleSpec {
// desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 replicas = 1;
}

View file

@ -35,9 +35,9 @@ const (
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}

View file

@ -202,15 +202,15 @@ message HorizontalPodAutoscalerSpec {
// metric is configured. Scaling is active as long as at least one metric value is
// available.
// +optional
// +k8s:optional
// +k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
optional int32 minReplicas = 2;
// maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
// +required
// +k8s:required
// +k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:minimum=1
optional int32 maxReplicas = 3;
// targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
@ -478,9 +478,9 @@ message Scale {
message ScaleSpec {
// replicas is the desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 replicas = 1;
}

View file

@ -47,15 +47,15 @@ type HorizontalPodAutoscalerSpec struct {
// metric is configured. Scaling is active as long as at least one metric value is
// available.
// +optional
// +k8s:optional
// +k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
// maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
// +required
// +k8s:required
// +k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:minimum=1
MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
// targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
@ -145,9 +145,9 @@ type Scale struct {
type ScaleSpec struct {
// replicas is the desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}

View file

@ -248,16 +248,16 @@ message HorizontalPodAutoscalerSpec {
// metric is configured. Scaling is active as long as at least one metric value is
// available.
// +optional
// +k8s:optional
// +k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
optional int32 minReplicas = 2;
// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
// It cannot be less that minReplicas.
// +required
// +k8s:required
// +k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:minimum=1
optional int32 maxReplicas = 3;
// metrics contains the specifications for which to use to calculate the

View file

@ -59,16 +59,16 @@ type HorizontalPodAutoscalerSpec struct {
// metric is configured. Scaling is active as long as at least one metric value is
// available.
// +optional
// +k8s:optional
// +k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1
MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
// It cannot be less that minReplicas.
// +required
// +k8s:required
// +k8s:minimum=1
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:minimum=1
MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
// metrics contains the specifications for which to use to calculate the

View file

@ -62,7 +62,7 @@ message CronJobList {
message CronJobSpec {
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string schedule = 1;
// The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

View file

@ -716,7 +716,7 @@ type CronJobSpec struct {
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Schedule string `json:"schedule" protobuf:"bytes,1,opt,name=schedule"`
// The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

View file

@ -63,7 +63,7 @@ message CronJobList {
message CronJobSpec {
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string schedule = 1;
// The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

View file

@ -85,7 +85,7 @@ type CronJobSpec struct {
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Schedule string `json:"schedule" protobuf:"bytes,1,opt,name=schedule"`
// The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

View file

@ -204,12 +204,12 @@ message CertificateSigningRequestStatus {
// +listType=map
// +listMapKey=type
// +optional
// +k8s:listType=map
// +k8s:listMapKey=type
// +k8s:customUnique
// +k8s:optional
// +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=type
// +k8s:alpha(since: "1.36")=+k8s:customUnique
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
repeated CertificateSigningRequestCondition conditions = 1;
// certificate is populated with an issued certificate by the signer after an Approved condition is present.

View file

@ -179,12 +179,12 @@ type CertificateSigningRequestStatus struct {
// +listType=map
// +listMapKey=type
// +optional
// +k8s:listType=map
// +k8s:listMapKey=type
// +k8s:customUnique
// +k8s:optional
// +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=type
// +k8s:alpha(since: "1.36")=+k8s:customUnique
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
// certificate is populated with an issued certificate by the signer after an Approved condition is present.

View file

@ -183,12 +183,12 @@ message CertificateSigningRequestStatus {
// +listType=map
// +listMapKey=type
// +optional
// +k8s:listType=map
// +k8s:listMapKey=type
// +k8s:customUnique
// +k8s:optional
// +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=type
// +k8s:alpha(since: "1.36")=+k8s:customUnique
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
repeated CertificateSigningRequestCondition conditions = 1;
// If request was approved, the controller will place the issued certificate here.

View file

@ -177,12 +177,12 @@ type CertificateSigningRequestStatus struct {
// +listType=map
// +listMapKey=type
// +optional
// +k8s:listType=map
// +k8s:listMapKey=type
// +k8s:customUnique
// +k8s:optional
// +k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=type
// +k8s:alpha(since: "1.36")=+k8s:customUnique
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember
// +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
// If request was approved, the controller will place the issued certificate here.

View file

@ -5305,8 +5305,8 @@ message ReplicationController {
// be the same as the Pod(s) that the replication controller manages.
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the replication controller.
@ -5363,18 +5363,18 @@ message ReplicationControllerSpec {
// Defaults to 1.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=1
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 replicas = 1;
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 minReadySeconds = 4;
// Selector is a label query over pods that should match the Replicas count.

View file

@ -5550,18 +5550,18 @@ type ReplicationControllerSpec struct {
// Defaults to 1.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=1
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
// Selector is a label query over pods that should match the Replicas count.
@ -5661,8 +5661,8 @@ type ReplicationController struct {
// be the same as the Pod(s) that the replication controller manages.
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the specification of the desired behavior of the replication controller.

View file

@ -39,8 +39,8 @@ message Endpoint {
// additional addresses beyond the first, and kube-proxy does not look at them.
// +listType=set
// +required
// +k8s:required
// +k8s:maxItems=100
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxItems=100
repeated string addresses = 1;
// conditions contains information about the current status of the endpoint.
@ -185,15 +185,15 @@ message EndpointSlice {
// slices of addressType "IPv4" and "IPv6". No semantics are defined for
// the "FQDN" type.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional string addressType = 4;
// endpoints is a list of unique endpoints in this slice. Each slice may
// include a maximum of 1000 endpoints.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Endpoint endpoints = 2;
// ports specifies the list of network ports exposed by each endpoint in

View file

@ -49,15 +49,15 @@ type EndpointSlice struct {
// slices of addressType "IPv4" and "IPv6". No semantics are defined for
// the "FQDN" type.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"`
// endpoints is a list of unique endpoints in this slice. Each slice may
// include a maximum of 1000 endpoints.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"`
// ports specifies the list of network ports exposed by each endpoint in
@ -73,7 +73,7 @@ type EndpointSlice struct {
// AddressType represents the type of address referred to by an endpoint.
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type AddressType string
const (
@ -97,8 +97,8 @@ type Endpoint struct {
// additional addresses beyond the first, and kube-proxy does not look at them.
// +listType=set
// +required
// +k8s:required
// +k8s:maxItems=100
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxItems=100
Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"`
// conditions contains information about the current status of the endpoint.

View file

@ -39,8 +39,8 @@ message Endpoint {
// use the first element. Refer to: https://issue.k8s.io/106267
// +listType=set
// +required
// +k8s:required
// +k8s:maxItems=100
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxItems=100
repeated string addresses = 1;
// conditions contains information about the current status of the endpoint.
@ -171,14 +171,14 @@ message EndpointSlice {
// * IPv6: Represents an IPv6 Address.
// * FQDN: Represents a Fully Qualified Domain Name.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional string addressType = 4;
// endpoints is a list of unique endpoints in this slice. Each slice may
// include a maximum of 1000 endpoints.
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Endpoint endpoints = 2;
// ports specifies the list of network ports exposed by each endpoint in

View file

@ -46,14 +46,14 @@ type EndpointSlice struct {
// * IPv6: Represents an IPv6 Address.
// * FQDN: Represents a Fully Qualified Domain Name.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"`
// endpoints is a list of unique endpoints in this slice. Each slice may
// include a maximum of 1000 endpoints.
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"`
// ports specifies the list of network ports exposed by each endpoint in
@ -68,7 +68,7 @@ type EndpointSlice struct {
// AddressType represents the type of address referred to by an endpoint.
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type AddressType string
const (
@ -92,8 +92,8 @@ type Endpoint struct {
// use the first element. Refer to: https://issue.k8s.io/106267
// +listType=set
// +required
// +k8s:required
// +k8s:maxItems=100
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxItems=100
Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"`
// conditions contains information about the current status of the endpoint.

View file

@ -429,7 +429,7 @@ message IPBlock {
// CIDR is a string representing the IP Block
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string cidr = 1;
// Except is a slice of CIDRs that should not be included within an IP Block
@ -688,7 +688,7 @@ message NetworkPolicyEgressRule {
// allows traffic only if the traffic matches at least one item in the to list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyPeer to = 2;
}
@ -711,7 +711,7 @@ message NetworkPolicyIngressRule {
// traffic matches at least one item in the from list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyPeer from = 2;
}
@ -750,7 +750,7 @@ message NetworkPolicyPeer {
// IPBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional IPBlock ipBlock = 3;
}
@ -794,7 +794,7 @@ message NetworkPolicySpec {
// (and serves solely to ensure that the pods it selects are isolated by default).
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyIngressRule ingress = 2;
// List of egress rules to be applied to the selected pods. Outgoing traffic is
@ -806,7 +806,7 @@ message NetworkPolicySpec {
// This field is beta-level in 1.8
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyEgressRule egress = 3;
// List of rule types that the NetworkPolicy relates to.
@ -1046,9 +1046,9 @@ message Scale {
message ScaleSpec {
// desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
optional int32 replicas = 1;
}

View file

@ -27,9 +27,9 @@ import (
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +default=0
// +k8s:minimum=0
// +k8s:alpha(since: "1.36")=+k8s:minimum=0
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}
@ -1106,7 +1106,7 @@ type NetworkPolicySpec struct {
// (and serves solely to ensure that the pods it selects are isolated by default).
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
// List of egress rules to be applied to the selected pods. Outgoing traffic is
@ -1118,7 +1118,7 @@ type NetworkPolicySpec struct {
// This field is beta-level in 1.8
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"`
// List of rule types that the NetworkPolicy relates to.
@ -1155,7 +1155,7 @@ type NetworkPolicyIngressRule struct {
// traffic matches at least one item in the from list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
}
@ -1180,7 +1180,7 @@ type NetworkPolicyEgressRule struct {
// allows traffic only if the traffic matches at least one item in the to list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"`
}
@ -1214,7 +1214,7 @@ type IPBlock struct {
// CIDR is a string representing the IP Block
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
CIDR string `json:"cidr" protobuf:"bytes,1,name=cidr"`
// Except is a slice of CIDRs that should not be included within an IP Block
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
@ -1247,7 +1247,7 @@ type NetworkPolicyPeer struct {
// IPBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"`
}

View file

@ -69,7 +69,7 @@ func Validate_IPBlock(ctx context.Context, op operation.Operation, fldPath *fiel
}
// call field-attached validations
earlyReturn := false
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
errs = append(errs, e...)
earlyReturn = true
}
@ -118,7 +118,7 @@ func Validate_NetworkPolicyEgressRule(ctx context.Context, op operation.Operatio
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -146,7 +146,7 @@ func Validate_NetworkPolicyIngressRule(ctx context.Context, op operation.Operati
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -175,7 +175,7 @@ func Validate_NetworkPolicyPeer(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -203,7 +203,7 @@ func Validate_NetworkPolicySpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -223,7 +223,7 @@ func Validate_NetworkPolicySpec(ctx context.Context, op operation.Operation, fld
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
@ -266,13 +266,12 @@ func Validate_ScaleSpec(ctx context.Context, op operation.Operation, fldPath *fi
// field ScaleSpec.Replicas
errs = append(errs,
func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
// optional value-type fields with zero-value defaults are purely documentation
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
return nil
}
// call field-attached validations
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...)
return
}(fldPath.Child("replicas"), &obj.Replicas, safe.Field(oldObj, func(oldObj *ScaleSpec) *int32 { return &oldObj.Replicas }), oldObj != nil)...)

View file

@ -107,8 +107,8 @@ message IPAddressSpec {
// ParentRef references the resource that an IPAddress is attached to.
// An IPAddress must reference a parent object.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional ParentReference parentRef = 1;
}
@ -119,7 +119,7 @@ message IPBlock {
// cidr is a string representing the IPBlock
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string cidr = 1;
// except is a slice of CIDRs that should not be included within an IPBlock
@ -204,12 +204,12 @@ message IngressClassParametersReference {
// kind is the type of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string kind = 2;
// name is the name of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
// scope represents if this refers to a cluster or namespace scoped resource.
@ -238,7 +238,7 @@ message IngressClassSpec {
// configuration for the controller. This is optional if the controller does
// not require extra parameters.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional IngressClassParametersReference parameters = 2;
}
@ -455,7 +455,7 @@ message NetworkPolicyEgressRule {
// allows traffic only if the traffic matches at least one item in the to list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyPeer to = 2;
}
@ -478,7 +478,7 @@ message NetworkPolicyIngressRule {
// allows traffic only if the traffic matches at least one item in the from list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyPeer from = 2;
}
@ -517,7 +517,7 @@ message NetworkPolicyPeer {
// ipBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional IPBlock ipBlock = 3;
}
@ -563,7 +563,7 @@ message NetworkPolicySpec {
// solely to ensure that the pods it selects are isolated by default)
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyIngressRule ingress = 2;
// egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
@ -575,7 +575,7 @@ message NetworkPolicySpec {
// This field is beta-level in 1.8
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated NetworkPolicyEgressRule egress = 3;
// policyTypes is a list of rule types that the NetworkPolicy relates to.
@ -601,7 +601,7 @@ message ParentReference {
// Resource is the resource of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string resource = 2;
// Namespace is the namespace of the object being referenced.
@ -610,7 +610,7 @@ message ParentReference {
// Name is the name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 4;
}

View file

@ -77,7 +77,7 @@ type NetworkPolicySpec struct {
// solely to ensure that the pods it selects are isolated by default)
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
// egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
@ -89,7 +89,7 @@ type NetworkPolicySpec struct {
// This field is beta-level in 1.8
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"`
// policyTypes is a list of rule types that the NetworkPolicy relates to.
@ -126,7 +126,7 @@ type NetworkPolicyIngressRule struct {
// allows traffic only if the traffic matches at least one item in the from list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
}
@ -150,7 +150,7 @@ type NetworkPolicyEgressRule struct {
// allows traffic only if the traffic matches at least one item in the to list.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"`
}
@ -183,7 +183,7 @@ type IPBlock struct {
// cidr is a string representing the IPBlock
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
CIDR string `json:"cidr" protobuf:"bytes,1,name=cidr"`
// except is a slice of CIDRs that should not be included within an IPBlock
@ -218,7 +218,7 @@ type NetworkPolicyPeer struct {
// ipBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"`
}
@ -590,7 +590,7 @@ type IngressClassSpec struct {
// configuration for the controller. This is optional if the controller does
// not require extra parameters.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
}
@ -614,12 +614,12 @@ type IngressClassParametersReference struct {
// kind is the type of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// name is the name of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// scope represents if this refers to a cluster or namespace scoped resource.
@ -678,8 +678,8 @@ type IPAddressSpec struct {
// ParentRef references the resource that an IPAddress is attached to.
// An IPAddress must reference a parent object.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"`
}
@ -690,14 +690,14 @@ type ParentReference struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
// Resource is the resource of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"`
// Namespace is the namespace of the object being referenced.
// +optional
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
// Name is the name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"`
}

View file

@ -108,8 +108,8 @@ message IPAddressSpec {
// ParentRef references the resource that an IPAddress is attached to.
// An IPAddress must reference a parent object.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional ParentReference parentRef = 1;
}
@ -189,12 +189,12 @@ message IngressClassParametersReference {
// kind is the type of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string kind = 2;
// name is the name of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
// scope represents if this refers to a cluster or namespace scoped resource.
@ -222,7 +222,7 @@ message IngressClassSpec {
// configuration for the controller. This is optional if the controller does
// not require extra parameters.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional IngressClassParametersReference parameters = 2;
}
@ -404,7 +404,7 @@ message ParentReference {
// Resource is the resource of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string resource = 2;
// Namespace is the namespace of the object being referenced.
@ -413,7 +413,7 @@ message ParentReference {
// Name is the name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 4;
}

View file

@ -368,7 +368,7 @@ type IngressClassSpec struct {
// configuration for the controller. This is optional if the controller does
// not require extra parameters.
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
}
@ -392,12 +392,12 @@ type IngressClassParametersReference struct {
// kind is the type of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// name is the name of resource being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// scope represents if this refers to a cluster or namespace scoped resource.
@ -456,8 +456,8 @@ type IPAddressSpec struct {
// ParentRef references the resource that an IPAddress is attached to.
// An IPAddress must reference a parent object.
// +required
// +k8s:required
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:immutable
ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"`
}
@ -468,14 +468,14 @@ type ParentReference struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
// Resource is the resource of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"`
// Namespace is the namespace of the object being referenced.
// +optional
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
// Name is the name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"`
}

View file

@ -60,9 +60,9 @@ message RuntimeClass {
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
optional string handler = 2;
// overhead represents the resource overhead associated with running a pod for a

View file

@ -51,9 +51,9 @@ type RuntimeClass struct {
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
// overhead represents the resource overhead associated with running a pod for a

View file

@ -82,9 +82,9 @@ message RuntimeClassSpec {
// The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
// requirements, and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
optional string runtimeHandler = 1;
// overhead represents the resource overhead associated with running a pod for a

View file

@ -61,9 +61,9 @@ type RuntimeClassSpec struct {
// The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
// requirements, and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
RuntimeHandler string `json:"runtimeHandler" protobuf:"bytes,1,opt,name=runtimeHandler"`
// overhead represents the resource overhead associated with running a pod for a

View file

@ -60,9 +60,9 @@ message RuntimeClass {
// The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
optional string handler = 2;
// overhead represents the resource overhead associated with running a pod for a

View file

@ -52,9 +52,9 @@ type RuntimeClass struct {
// The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable.
// +required
// +k8s:format="k8s-short-name"
// +k8s:immutable
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name"
// +k8s:alpha(since: "1.36")=+k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:required
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
// overhead represents the resource overhead associated with running a pod for a

View file

@ -46,7 +46,7 @@ message ClusterRole {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
@ -66,7 +66,7 @@ message ClusterRoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can only reference a ClusterRole in the global namespace.
@ -102,7 +102,7 @@ message PolicyRule {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string verbs = 1;
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -138,7 +138,7 @@ message Role {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
}
@ -153,7 +153,7 @@ message RoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -196,7 +196,7 @@ message RoleRef {
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
}
@ -217,7 +217,7 @@ message Subject {
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty

View file

@ -50,7 +50,7 @@ type PolicyRule struct {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -90,7 +90,7 @@ type Subject struct {
APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"`
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
// the Authorizer should report an error.
@ -109,7 +109,7 @@ type RoleRef struct {
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
}
@ -127,7 +127,7 @@ type Role struct {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
}
@ -147,7 +147,7 @@ type RoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -200,7 +200,7 @@ type ClusterRole struct {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
@ -235,7 +235,7 @@ type ClusterRoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can only reference a ClusterRole in the global namespace.

View file

@ -47,7 +47,7 @@ message ClusterRole {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
@ -68,7 +68,7 @@ message ClusterRoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can only reference a ClusterRole in the global namespace.
@ -105,7 +105,7 @@ message PolicyRule {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string verbs = 1;
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -142,7 +142,7 @@ message Role {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
}
@ -158,7 +158,7 @@ message RoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -201,7 +201,7 @@ message RoleRef {
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
}
@ -222,7 +222,7 @@ message Subject {
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty

View file

@ -50,7 +50,7 @@ type PolicyRule struct {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -90,7 +90,7 @@ type Subject struct {
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
// the Authorizer should report an error.
@ -108,7 +108,7 @@ type RoleRef struct {
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
}
@ -126,7 +126,7 @@ type Role struct {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
}
@ -146,7 +146,7 @@ type RoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -198,7 +198,7 @@ type ClusterRole struct {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
@ -233,7 +233,7 @@ type ClusterRoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can only reference a ClusterRole in the global namespace.

View file

@ -47,7 +47,7 @@ message ClusterRole {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
@ -68,7 +68,7 @@ message ClusterRoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can only reference a ClusterRole in the global namespace.
@ -105,7 +105,7 @@ message PolicyRule {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
repeated string verbs = 1;
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -143,7 +143,7 @@ message Role {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated PolicyRule rules = 2;
}
@ -159,7 +159,7 @@ message RoleBinding {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated Subject subjects = 2;
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -202,7 +202,7 @@ message RoleRef {
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
}
@ -222,7 +222,7 @@ message Subject {
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string name = 3;
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty

View file

@ -50,7 +50,7 @@ type PolicyRule struct {
// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
// +listType=atomic
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
@ -90,7 +90,7 @@ type Subject struct {
APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"`
// Name of the object being referenced.
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
// the Authorizer should report an error.
@ -108,7 +108,7 @@ type RoleRef struct {
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// Name is the name of resource being referenced
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
}
@ -130,7 +130,7 @@ type Role struct {
// Rules holds all the PolicyRules for this Role
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
}
@ -154,7 +154,7 @@ type RoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
@ -218,7 +218,7 @@ type ClusterRole struct {
// Rules holds all the PolicyRules for this ClusterRole
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
// AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
// If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be
@ -256,7 +256,7 @@ type ClusterRoleBinding struct {
// Subjects holds references to the objects the role applies to.
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"`
// RoleRef can only reference a ClusterRole in the global namespace.

View file

@ -65,8 +65,8 @@ message AllocatedDeviceStatus {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 7;
// Conditions contains the latest observation of the device's state.
@ -90,7 +90,7 @@ message AllocatedDeviceStatus {
// NetworkData contains network-related information specific to the device.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional NetworkDeviceData networkData = 6;
}
@ -307,8 +307,8 @@ message CounterSet {
// It must be a DNS label.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string name = 1;
// Counters defines the set of counters for this CounterSet
@ -317,8 +317,8 @@ message CounterSet {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -337,7 +337,7 @@ message Device {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
map<string, DeviceAttribute> attributes = 2;
// Capacity defines the set of capacities for this device.
@ -358,13 +358,13 @@ message Device {
// device is 2.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=counterSet
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
// +featureGate=DRAPartitionableDevices
// +k8s:maxItems=2
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
repeated DeviceCounterConsumption consumesCounters = 4;
// NodeName identifies the node where the device is available.
@ -411,7 +411,7 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceTaint taints = 8;
// BindsToNode indicates if the usage of an allocation involving this device
@ -441,8 +441,8 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 10;
// BindingFailureConditions defines the conditions for binding failure.
@ -459,8 +459,8 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 11;
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
@ -480,7 +480,7 @@ message DeviceAllocationConfiguration {
// or from a claim.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string source = 1;
// Requests lists the names of requests where the configuration applies.
@ -492,10 +492,10 @@ message DeviceAllocationConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 2;
optional DeviceConfiguration deviceConfiguration = 3;
@ -507,8 +507,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequestAllocationResult results = 1;
// This field is a combination of all the claim and class configuration parameters.
@ -521,8 +521,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=64
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
repeated DeviceAllocationConfiguration config = 2;
}
@ -531,30 +531,30 @@ message DeviceAttribute {
// IntValue is a number.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional int64 int = 2;
// BoolValue is a true/false value.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional bool bool = 3;
// StringValue is a string. Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string string = 4;
// VersionValue is a semantic version according to semver.org spec 2.0.0.
// Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string version = 5;
}
@ -591,11 +591,11 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequest requests = 1;
// These constraints must be satisfied by the set of devices that get
@ -603,8 +603,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceConstraint constraints = 2;
// This field holds configuration for multiple potential drivers which
@ -613,8 +613,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClaimConfiguration config = 3;
}
@ -629,10 +629,10 @@ message DeviceClaimConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
optional DeviceConfiguration deviceConfiguration = 2;
@ -645,8 +645,8 @@ message DeviceClaimConfiguration {
message DeviceClass {
// Standard object metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines what can be allocated and how to configure it.
@ -682,8 +682,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 1;
// Config defines configuration parameters that apply to each device that is claimed via this class.
@ -694,8 +694,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClassConfiguration config = 2;
// ExtendedResourceName is the extended resource name for the devices of this class.
@ -710,8 +710,8 @@ message DeviceClassSpec {
// This is an alpha field.
// +optional
// +featureGate=DRAExtendedResource
// +k8s:optional
// +k8s:format=k8s-extended-resource-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
optional string extendedResourceName = 4;
}
@ -723,7 +723,7 @@ message DeviceConfiguration {
//
// +optional
// +oneOf=ConfigurationType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional OpaqueDeviceConfiguration opaque = 1;
}
@ -741,10 +741,10 @@ message DeviceConstraint {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
// MatchAttribute requires that all devices in question have this
@ -762,8 +762,8 @@ message DeviceConstraint {
//
// +optional
// +oneOf=ConstraintType
// +k8s:optional
// +k8s:format=k8s-resource-fully-qualified-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
optional string matchAttribute = 2;
// DistinctAttribute requires that all devices in question have this
@ -790,8 +790,8 @@ message DeviceCounterConsumption {
// counters defined will be consumed.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string counterSet = 1;
// Counters defines the counters that will be consumed by the device.
@ -799,8 +799,8 @@ message DeviceCounterConsumption {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -830,7 +830,7 @@ message DeviceRequest {
//
// +optional
// +oneOf=deviceRequestType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional ExactDeviceRequest exactly = 2;
// FirstAvailable contains subrequests, of which exactly one will be
@ -851,11 +851,11 @@ message DeviceRequest {
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated DeviceSubRequest firstAvailable = 3;
}
@ -880,9 +880,9 @@ message DeviceRequestAllocationResult {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:format=k8s-long-name-caseless
// +k8s:required
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
optional string driver = 2;
// This name together with the driver name and the device name field
@ -892,8 +892,8 @@ message DeviceRequestAllocationResult {
// DNS sub-domains separated by slashes.
//
// +required
// +k8s:required
// +k8s:format=k8s-resource-pool-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
optional string pool = 3;
// Device references one device instance via its name in the driver's
@ -925,7 +925,7 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// BindingConditions contains a copy of the BindingConditions
@ -937,8 +937,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 7;
// BindingFailureConditions contains a copy of the BindingFailureConditions
@ -950,8 +950,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 8;
// ShareID uniquely identifies an individual allocation share of the device,
@ -961,8 +961,8 @@ message DeviceRequestAllocationResult {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 9;
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
@ -1019,8 +1019,8 @@ message DeviceSubRequest {
// to reference.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
optional string deviceClassName = 2;
// Selectors define criteria which must be satisfied by a specific
@ -1030,8 +1030,8 @@ message DeviceSubRequest {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 3;
// AllocationMode and its related fields define how devices are allocated
@ -1053,7 +1053,7 @@ message DeviceSubRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 4;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1084,7 +1084,7 @@ message DeviceSubRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// Capacity define resource requirements against each capacity.
@ -1131,7 +1131,7 @@ message DeviceTaint {
// Consumers must treat unknown effects like None.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string effect = 3;
// TimeAdded represents the time at which the taint was added.
@ -1149,8 +1149,8 @@ message DeviceToleration {
// Must be a label name.
//
// +optional
// +k8s:optional
// +k8s:format=k8s-label-key
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
optional string key = 1;
// Operator represents a key's relationship to the value.
@ -1160,7 +1160,7 @@ message DeviceToleration {
//
// +optional
// +default="Equal"
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string operator = 2;
// Value is the taint value the toleration matches to.
@ -1174,7 +1174,7 @@ message DeviceToleration {
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string effect = 4;
// TolerationSeconds represents the period of time the toleration (which must be
@ -1212,8 +1212,8 @@ message ExactDeviceRequest {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 2;
// AllocationMode and its related fields define how devices are allocated
@ -1236,7 +1236,7 @@ message ExactDeviceRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 3;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1281,7 +1281,7 @@ message ExactDeviceRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// Capacity define resource requirements against each capacity.
@ -1313,8 +1313,8 @@ message NetworkDeviceData {
// Must not be longer than 256 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=256
optional string interfaceName = 1;
// IPs lists the network addresses assigned to the device's network interface.
@ -1325,10 +1325,10 @@ message NetworkDeviceData {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
repeated string ips = 2;
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
@ -1336,8 +1336,8 @@ message NetworkDeviceData {
// Must not be longer than 128 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=128
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=128
optional string hardwareAddress = 3;
}
@ -1354,9 +1354,9 @@ message OpaqueDeviceConfiguration {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name-caseless
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
optional string driver = 1;
// Parameters can contain arbitrary data. It is the responsibility of
@ -1382,7 +1382,7 @@ message ResourceClaim {
// Spec describes what is being requested and how to configure it.
// The spec is immutable.
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional ResourceClaimSpec spec = 2;
// Status describes whether the claim is ready to use and what has been allocated.
@ -1437,8 +1437,8 @@ message ResourceClaimStatus {
// Allocation is set once the claim has been allocated successfully.
//
// +optional
// +k8s:optional
// +k8s:update=NoModify
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
optional AllocationResult allocation = 1;
// ReservedFor indicates which entities are currently allowed to use
@ -1466,10 +1466,10 @@ message ResourceClaimStatus {
// +listMapKey=uid
// +patchStrategy=merge
// +patchMergeKey=uid
// +k8s:optional
// +k8s:listType=map
// +k8s:listMapKey=uid
// +k8s:maxItems=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
repeated ResourceClaimConsumerReference reservedFor = 2;
// Devices contains the status of each device allocated for this
@ -1477,18 +1477,18 @@ message ResourceClaimStatus {
// information. Entries are owned by their respective drivers.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=map
// +listMapKey=driver
// +listMapKey=device
// +listMapKey=pool
// +listMapKey=shareID
// +featureGate=DRAResourceClaimDeviceStatus
// +k8s:listType=map
// +k8s:listMapKey=driver
// +k8s:listMapKey=device
// +k8s:listMapKey=pool
// +k8s:listMapKey=shareID
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
repeated AllocatedDeviceStatus devices = 4;
}
@ -1671,7 +1671,7 @@ message ResourceSliceSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +zeroOrOneOf=ResourceSliceType
repeated Device devices = 6;
@ -1697,14 +1697,14 @@ message ResourceSliceSpec {
// The maximum number of counter sets is 8.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +featureGate=DRAPartitionableDevices
// +zeroOrOneOf=ResourceSliceType
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated CounterSet sharedCounters = 8;
}

View file

@ -153,7 +153,7 @@ type ResourceSliceSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +zeroOrOneOf=ResourceSliceType
Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"`
@ -179,14 +179,14 @@ type ResourceSliceSpec struct {
// The maximum number of counter sets is 8.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +featureGate=DRAPartitionableDevices
// +zeroOrOneOf=ResourceSliceType
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"`
}
@ -203,8 +203,8 @@ type CounterSet struct {
// It must be a DNS label.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
Name string `json:"name" protobuf:"bytes,1,name=name"`
// Counters defines the set of counters for this CounterSet
@ -213,8 +213,8 @@ type CounterSet struct {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"`
}
@ -298,7 +298,7 @@ type Device struct {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,2,rep,name=attributes"`
// Capacity defines the set of capacities for this device.
@ -319,13 +319,13 @@ type Device struct {
// device is 2.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=counterSet
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
// +featureGate=DRAPartitionableDevices
// +k8s:maxItems=2
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,4,rep,name=consumesCounters"`
// NodeName identifies the node where the device is available.
@ -372,7 +372,7 @@ type Device struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,8,rep,name=taints"`
// BindsToNode indicates if the usage of an allocation involving this device
@ -402,8 +402,8 @@ type Device struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,10,rep,name=bindingConditions"`
// BindingFailureConditions defines the conditions for binding failure.
@ -420,8 +420,8 @@ type Device struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,11,rep,name=bindingFailureConditions"`
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
@ -441,8 +441,8 @@ type DeviceCounterConsumption struct {
// counters defined will be consumed.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"`
// Counters defines the counters that will be consumed by the device.
@ -450,8 +450,8 @@ type DeviceCounterConsumption struct {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"`
}
@ -611,30 +611,30 @@ type DeviceAttribute struct {
// IntValue is a number.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"`
// BoolValue is a true/false value.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"`
// StringValue is a string. Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"`
// VersionValue is a semantic version according to semver.org spec 2.0.0.
// Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"`
}
@ -670,7 +670,7 @@ type DeviceTaint struct {
// Consumers must treat unknown effects like None.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"`
// ^^^^
@ -700,7 +700,7 @@ type DeviceTaint struct {
}
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceTaintEffect string
const (
@ -748,7 +748,7 @@ type ResourceClaim struct {
// Spec describes what is being requested and how to configure it.
// The spec is immutable.
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:immutable
Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
// Status describes whether the claim is ready to use and what has been allocated.
@ -776,11 +776,11 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"`
// These constraints must be satisfied by the set of devices that get
@ -788,8 +788,8 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"`
// This field holds configuration for multiple potential drivers which
@ -798,8 +798,8 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"`
// Potential future extension, ignored by older schedulers. This is
@ -850,7 +850,7 @@ type DeviceRequest struct {
//
// +optional
// +oneOf=deviceRequestType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Exactly *ExactDeviceRequest `json:"exactly,omitempty" protobuf:"bytes,2,name=exactly"`
// FirstAvailable contains subrequests, of which exactly one will be
@ -871,11 +871,11 @@ type DeviceRequest struct {
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,3,name=firstAvailable"`
}
@ -903,8 +903,8 @@ type ExactDeviceRequest struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,2,name=selectors"`
// AllocationMode and its related fields define how devices are allocated
@ -927,7 +927,7 @@ type ExactDeviceRequest struct {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"`
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -972,7 +972,7 @@ type ExactDeviceRequest struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
// Capacity define resource requirements against each capacity.
@ -1024,8 +1024,8 @@ type DeviceSubRequest struct {
// to reference.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"`
// Selectors define criteria which must be satisfied by a specific
@ -1035,8 +1035,8 @@ type DeviceSubRequest struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"`
// AllocationMode and its related fields define how devices are allocated
@ -1058,7 +1058,7 @@ type DeviceSubRequest struct {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"`
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1089,7 +1089,7 @@ type DeviceSubRequest struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
// Capacity define resource requirements against each capacity.
@ -1146,7 +1146,7 @@ const (
)
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceAllocationMode string
// Valid [DeviceRequest.CountMode] values.
@ -1265,10 +1265,10 @@ type DeviceConstraint struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
// MatchAttribute requires that all devices in question have this
@ -1286,8 +1286,8 @@ type DeviceConstraint struct {
//
// +optional
// +oneOf=ConstraintType
// +k8s:optional
// +k8s:format=k8s-resource-fully-qualified-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"`
// Potential future extension, not part of the current design:
@ -1328,10 +1328,10 @@ type DeviceClaimConfiguration struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"`
@ -1345,7 +1345,7 @@ type DeviceConfiguration struct {
//
// +optional
// +oneOf=ConfigurationType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
}
@ -1362,9 +1362,9 @@ type OpaqueDeviceConfiguration struct {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name-caseless
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
Driver string `json:"driver" protobuf:"bytes,1,name=driver"`
// Parameters can contain arbitrary data. It is the responsibility of
@ -1390,8 +1390,8 @@ type DeviceToleration struct {
// Must be a label name.
//
// +optional
// +k8s:optional
// +k8s:format=k8s-label-key
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"`
// Operator represents a key's relationship to the value.
@ -1401,7 +1401,7 @@ type DeviceToleration struct {
//
// +optional
// +default="Equal"
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"`
// Value is the taint value the toleration matches to.
@ -1415,7 +1415,7 @@ type DeviceToleration struct {
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"`
// TolerationSeconds represents the period of time the toleration (which must be
@ -1432,7 +1432,7 @@ type DeviceToleration struct {
// A toleration operator is the set of operators that can be used in a toleration.
//
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceTolerationOperator string
const (
@ -1446,8 +1446,8 @@ type ResourceClaimStatus struct {
// Allocation is set once the claim has been allocated successfully.
//
// +optional
// +k8s:optional
// +k8s:update=NoModify
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"`
// ReservedFor indicates which entities are currently allowed to use
@ -1475,10 +1475,10 @@ type ResourceClaimStatus struct {
// +listMapKey=uid
// +patchStrategy=merge
// +patchMergeKey=uid
// +k8s:optional
// +k8s:listType=map
// +k8s:listMapKey=uid
// +k8s:maxItems=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
// DeallocationRequested is tombstoned since Kubernetes 1.32 where
@ -1491,18 +1491,18 @@ type ResourceClaimStatus struct {
// information. Entries are owned by their respective drivers.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=map
// +listMapKey=driver
// +listMapKey=device
// +listMapKey=pool
// +listMapKey=shareID
// +featureGate=DRAResourceClaimDeviceStatus
// +k8s:listType=map
// +k8s:listMapKey=driver
// +k8s:listMapKey=device
// +k8s:listMapKey=pool
// +k8s:listMapKey=shareID
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
}
@ -1565,8 +1565,8 @@ type DeviceAllocationResult struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"`
// This field is a combination of all the claim and class configuration parameters.
@ -1579,8 +1579,8 @@ type DeviceAllocationResult struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=64
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
}
@ -1609,9 +1609,9 @@ type DeviceRequestAllocationResult struct {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:format=k8s-long-name-caseless
// +k8s:required
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
Driver string `json:"driver" protobuf:"bytes,2,name=driver"`
// This name together with the driver name and the device name field
@ -1621,8 +1621,8 @@ type DeviceRequestAllocationResult struct {
// DNS sub-domains separated by slashes.
//
// +required
// +k8s:required
// +k8s:format=k8s-resource-pool-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
Pool string `json:"pool" protobuf:"bytes,3,name=pool"`
// Device references one device instance via its name in the driver's
@ -1654,7 +1654,7 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
// BindingConditions contains a copy of the BindingConditions
@ -1666,8 +1666,8 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"`
// BindingFailureConditions contains a copy of the BindingFailureConditions
@ -1679,8 +1679,8 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"`
// ShareID uniquely identifies an individual allocation share of the device,
@ -1690,8 +1690,8 @@ type DeviceRequestAllocationResult struct {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"`
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
@ -1715,7 +1715,7 @@ type DeviceAllocationConfiguration struct {
// or from a claim.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"`
// Requests lists the names of requests where the configuration applies.
@ -1727,17 +1727,17 @@ type DeviceAllocationConfiguration struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"`
DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"`
}
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type AllocationConfigSource string
// Valid [DeviceAllocationConfiguration.Source] values.
@ -1773,8 +1773,8 @@ type DeviceClass struct {
metav1.TypeMeta `json:",inline"`
// Standard object metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines what can be allocated and how to configure it.
@ -1795,8 +1795,8 @@ type DeviceClassSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"`
// Config defines configuration parameters that apply to each device that is claimed via this class.
@ -1807,8 +1807,8 @@ type DeviceClassSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
// SuitableNodes is tombstoned since Kubernetes 1.32 where
@ -1828,8 +1828,8 @@ type DeviceClassSpec struct {
// This is an alpha field.
// +optional
// +featureGate=DRAExtendedResource
// +k8s:optional
// +k8s:format=k8s-extended-resource-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"`
}
@ -1952,8 +1952,8 @@ type AllocatedDeviceStatus struct {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"`
// Conditions contains the latest observation of the device's state.
@ -1977,7 +1977,7 @@ type AllocatedDeviceStatus struct {
// NetworkData contains network-related information specific to the device.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"`
}
@ -1992,8 +1992,8 @@ type NetworkDeviceData struct {
// Must not be longer than 256 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=256
InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"`
// IPs lists the network addresses assigned to the device's network interface.
@ -2004,10 +2004,10 @@ type NetworkDeviceData struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"`
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
@ -2015,7 +2015,7 @@ type NetworkDeviceData struct {
// Must not be longer than 128 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=128
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=128
HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"`
}

View file

@ -65,8 +65,8 @@ message AllocatedDeviceStatus {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 7;
// Conditions contains the latest observation of the device's state.
@ -90,7 +90,7 @@ message AllocatedDeviceStatus {
// NetworkData contains network-related information specific to the device.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional NetworkDeviceData networkData = 6;
}
@ -126,7 +126,7 @@ message BasicDevice {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
map<string, DeviceAttribute> attributes = 1;
// Capacity defines the set of capacities for this device.
@ -147,13 +147,13 @@ message BasicDevice {
// device is 2.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=counterSet
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
// +featureGate=DRAPartitionableDevices
// +k8s:maxItems=2
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
repeated DeviceCounterConsumption consumesCounters = 3;
// NodeName identifies the node where the device is available.
@ -199,7 +199,7 @@ message BasicDevice {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceTaint taints = 7;
// BindsToNode indicates if the usage of an allocation involving this device
@ -229,8 +229,8 @@ message BasicDevice {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 9;
// BindingFailureConditions defines the conditions for binding failure.
@ -247,8 +247,8 @@ message BasicDevice {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 10;
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
@ -450,8 +450,8 @@ message CounterSet {
// It must be a DNS label.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string name = 1;
// Counters defines the set of counters for this CounterSet
@ -460,8 +460,8 @@ message CounterSet {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -478,7 +478,7 @@ message Device {
//
// +optional
// +oneOf=deviceType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional BasicDevice basic = 2;
}
@ -489,7 +489,7 @@ message DeviceAllocationConfiguration {
// or from a claim.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string source = 1;
// Requests lists the names of requests where the configuration applies.
@ -501,10 +501,10 @@ message DeviceAllocationConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 2;
optional DeviceConfiguration deviceConfiguration = 3;
@ -516,8 +516,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequestAllocationResult results = 1;
// This field is a combination of all the claim and class configuration parameters.
@ -530,8 +530,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=64
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
repeated DeviceAllocationConfiguration config = 2;
}
@ -540,30 +540,30 @@ message DeviceAttribute {
// IntValue is a number.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional int64 int = 2;
// BoolValue is a true/false value.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional bool bool = 3;
// StringValue is a string. Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string string = 4;
// VersionValue is a semantic version according to semver.org spec 2.0.0.
// Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string version = 5;
}
@ -600,11 +600,11 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequest requests = 1;
// These constraints must be satisfied by the set of devices that get
@ -612,8 +612,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceConstraint constraints = 2;
// This field holds configuration for multiple potential drivers which
@ -622,8 +622,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClaimConfiguration config = 3;
}
@ -638,10 +638,10 @@ message DeviceClaimConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
optional DeviceConfiguration deviceConfiguration = 2;
@ -657,8 +657,8 @@ message DeviceClaimConfiguration {
message DeviceClass {
// Standard object metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines what can be allocated and how to configure it.
@ -694,8 +694,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 1;
// Config defines configuration parameters that apply to each device that is claimed via this class.
@ -706,8 +706,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClassConfiguration config = 2;
// ExtendedResourceName is the extended resource name for the devices of this class.
@ -722,8 +722,8 @@ message DeviceClassSpec {
// This is an alpha field.
// +optional
// +featureGate=DRAExtendedResource
// +k8s:optional
// +k8s:format=k8s-extended-resource-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
optional string extendedResourceName = 4;
}
@ -735,7 +735,7 @@ message DeviceConfiguration {
//
// +optional
// +oneOf=ConfigurationType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional OpaqueDeviceConfiguration opaque = 1;
}
@ -753,10 +753,10 @@ message DeviceConstraint {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
// MatchAttribute requires that all devices in question have this
@ -774,8 +774,8 @@ message DeviceConstraint {
//
// +optional
// +oneOf=ConstraintType
// +k8s:optional
// +k8s:format=k8s-resource-fully-qualified-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
optional string matchAttribute = 2;
// DistinctAttribute requires that all devices in question have this
@ -802,8 +802,8 @@ message DeviceCounterConsumption {
// counters defined will be consumed.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string counterSet = 1;
// Counters defines the counters that will be consumed by the device.
@ -811,8 +811,8 @@ message DeviceCounterConsumption {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -858,8 +858,8 @@ message DeviceRequest {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 3;
// AllocationMode and its related fields define how devices are allocated
@ -885,7 +885,7 @@ message DeviceRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 4;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -935,11 +935,11 @@ message DeviceRequest {
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated DeviceSubRequest firstAvailable = 7;
// If specified, the request's tolerations.
@ -966,7 +966,7 @@ message DeviceRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 8;
// Capacity define resource requirements against each capacity.
@ -1008,9 +1008,9 @@ message DeviceRequestAllocationResult {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:format=k8s-long-name-caseless
// +k8s:required
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
optional string driver = 2;
// This name together with the driver name and the device name field
@ -1020,8 +1020,8 @@ message DeviceRequestAllocationResult {
// DNS sub-domains separated by slashes.
//
// +required
// +k8s:required
// +k8s:format=k8s-resource-pool-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
optional string pool = 3;
// Device references one device instance via its name in the driver's
@ -1053,8 +1053,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
repeated DeviceToleration tolerations = 6;
// BindingConditions contains a copy of the BindingConditions
@ -1066,8 +1066,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 7;
// BindingFailureConditions contains a copy of the BindingFailureConditions
@ -1079,8 +1079,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 8;
// ShareID uniquely identifies an individual allocation share of the device,
@ -1090,8 +1090,8 @@ message DeviceRequestAllocationResult {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 9;
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
@ -1149,8 +1149,8 @@ message DeviceSubRequest {
// to reference.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
optional string deviceClassName = 2;
// Selectors define criteria which must be satisfied by a specific
@ -1160,8 +1160,8 @@ message DeviceSubRequest {
//
// +optional
// +listType=atomic
// +k8s:maxItems=32
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceSelector selectors = 3;
// AllocationMode and its related fields define how devices are allocated
@ -1183,7 +1183,7 @@ message DeviceSubRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 4;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1214,7 +1214,7 @@ message DeviceSubRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 7;
// Capacity define resource requirements against each capacity.
@ -1261,7 +1261,7 @@ message DeviceTaint {
// Consumers must treat unknown effects like None.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string effect = 3;
// TimeAdded represents the time at which the taint was added.
@ -1279,8 +1279,8 @@ message DeviceToleration {
// Must be a label name.
//
// +optional
// +k8s:optional
// +k8s:format=k8s-label-key
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
optional string key = 1;
// Operator represents a key's relationship to the value.
@ -1290,7 +1290,7 @@ message DeviceToleration {
//
// +optional
// +default="Equal"
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string operator = 2;
// Value is the taint value the toleration matches to.
@ -1304,7 +1304,7 @@ message DeviceToleration {
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string effect = 4;
// TolerationSeconds represents the period of time the toleration (which must be
@ -1329,8 +1329,8 @@ message NetworkDeviceData {
// Must not be longer than 256 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=256
optional string interfaceName = 1;
// IPs lists the network addresses assigned to the device's network interface.
@ -1343,10 +1343,10 @@ message NetworkDeviceData {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
repeated string ips = 2;
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
@ -1354,8 +1354,8 @@ message NetworkDeviceData {
// Must not be longer than 128 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=128
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=128
optional string hardwareAddress = 3;
}
@ -1372,9 +1372,9 @@ message OpaqueDeviceConfiguration {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:required
// +k8s:maxLength=63
// +k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
optional string driver = 1;
// Parameters can contain arbitrary data. It is the responsibility of
@ -1403,7 +1403,7 @@ message ResourceClaim {
// Spec describes what is being requested and how to configure it.
// The spec is immutable.
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional ResourceClaimSpec spec = 2;
// Status describes whether the claim is ready to use and what has been allocated.
@ -1458,8 +1458,8 @@ message ResourceClaimStatus {
// Allocation is set once the claim has been allocated successfully.
//
// +optional
// +k8s:optional
// +k8s:update=NoModify
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
optional AllocationResult allocation = 1;
// ReservedFor indicates which entities are currently allowed to use
@ -1487,10 +1487,10 @@ message ResourceClaimStatus {
// +listMapKey=uid
// +patchStrategy=merge
// +patchMergeKey=uid
// +k8s:optional
// +k8s:listType=map
// +k8s:listMapKey=uid
// +k8s:maxItems=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
repeated ResourceClaimConsumerReference reservedFor = 2;
// Devices contains the status of each device allocated for this
@ -1498,18 +1498,18 @@ message ResourceClaimStatus {
// information. Entries are owned by their respective drivers.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=map
// +listMapKey=driver
// +listMapKey=device
// +listMapKey=pool
// +listMapKey=shareID
// +featureGate=DRAResourceClaimDeviceStatus
// +k8s:listType=map
// +k8s:listMapKey=driver
// +k8s:listMapKey=device
// +k8s:listMapKey=pool
// +k8s:listMapKey=shareID
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
repeated AllocatedDeviceStatus devices = 4;
}
@ -1698,7 +1698,7 @@ message ResourceSliceSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +zeroOrOneOf=ResourceSliceType
repeated Device devices = 6;
@ -1724,14 +1724,14 @@ message ResourceSliceSpec {
// The maximum number of counter sets is 8.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +featureGate=DRAPartitionableDevices
// +zeroOrOneOf=ResourceSliceType
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated CounterSet sharedCounters = 8;
}

View file

@ -156,7 +156,7 @@ type ResourceSliceSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +zeroOrOneOf=ResourceSliceType
Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"`
@ -182,14 +182,14 @@ type ResourceSliceSpec struct {
// The maximum number of counter sets is 8.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +featureGate=DRAPartitionableDevices
// +zeroOrOneOf=ResourceSliceType
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"`
}
@ -206,8 +206,8 @@ type CounterSet struct {
// It must be a DNS label.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
Name string `json:"name" protobuf:"bytes,1,name=name"`
// Counters defines the set of counters for this CounterSet
@ -216,8 +216,8 @@ type CounterSet struct {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"`
}
@ -307,7 +307,7 @@ type Device struct {
//
// +optional
// +oneOf=deviceType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Basic *BasicDevice `json:"basic,omitempty" protobuf:"bytes,2,opt,name=basic"`
}
@ -319,7 +319,7 @@ type BasicDevice struct {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,1,rep,name=attributes"`
// Capacity defines the set of capacities for this device.
@ -340,13 +340,13 @@ type BasicDevice struct {
// device is 2.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=counterSet
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
// +featureGate=DRAPartitionableDevices
// +k8s:maxItems=2
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,3,rep,name=consumesCounters"`
// NodeName identifies the node where the device is available.
@ -392,7 +392,7 @@ type BasicDevice struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,7,rep,name=taints"`
// BindsToNode indicates if the usage of an allocation involving this device
@ -422,8 +422,8 @@ type BasicDevice struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,9,rep,name=bindingConditions"`
// BindingFailureConditions defines the conditions for binding failure.
@ -440,8 +440,8 @@ type BasicDevice struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,10,rep,name=bindingFailureConditions"`
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
@ -461,8 +461,8 @@ type DeviceCounterConsumption struct {
// counters defined will be consumed.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"`
// Counters defines the counters that will be consumed by the device.
@ -470,8 +470,8 @@ type DeviceCounterConsumption struct {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"`
}
@ -623,30 +623,30 @@ type DeviceAttribute struct {
// IntValue is a number.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"`
// BoolValue is a true/false value.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"`
// StringValue is a string. Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"`
// VersionValue is a semantic version according to semver.org spec 2.0.0.
// Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"`
}
@ -682,7 +682,7 @@ type DeviceTaint struct {
// Consumers must treat unknown effects like None.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"`
// ^^^^
@ -712,7 +712,7 @@ type DeviceTaint struct {
}
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceTaintEffect string
const (
@ -763,7 +763,7 @@ type ResourceClaim struct {
// Spec describes what is being requested and how to configure it.
// The spec is immutable.
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:immutable
Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
// Status describes whether the claim is ready to use and what has been allocated.
@ -791,11 +791,11 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"`
// These constraints must be satisfied by the set of devices that get
@ -803,8 +803,8 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"`
// This field holds configuration for multiple potential drivers which
@ -813,8 +813,8 @@ type DeviceClaim struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"`
// Potential future extension, ignored by older schedulers. This is
@ -881,8 +881,8 @@ type DeviceRequest struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"`
// AllocationMode and its related fields define how devices are allocated
@ -908,7 +908,7 @@ type DeviceRequest struct {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"`
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -958,11 +958,11 @@ type DeviceRequest struct {
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,7,name=firstAvailable"`
// If specified, the request's tolerations.
@ -989,7 +989,7 @@ type DeviceRequest struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,8,opt,name=tolerations"`
// Capacity define resource requirements against each capacity.
@ -1042,8 +1042,8 @@ type DeviceSubRequest struct {
// to reference.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"`
// Selectors define criteria which must be satisfied by a specific
@ -1053,8 +1053,8 @@ type DeviceSubRequest struct {
//
// +optional
// +listType=atomic
// +k8s:maxItems=32
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"`
// AllocationMode and its related fields define how devices are allocated
@ -1076,7 +1076,7 @@ type DeviceSubRequest struct {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"`
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1107,7 +1107,7 @@ type DeviceSubRequest struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,7,opt,name=tolerations"`
// Capacity define resource requirements against each capacity.
@ -1164,7 +1164,7 @@ const (
)
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceAllocationMode string
// Valid [DeviceRequest.CountMode] values.
@ -1283,10 +1283,10 @@ type DeviceConstraint struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
// MatchAttribute requires that all devices in question have this
@ -1304,8 +1304,8 @@ type DeviceConstraint struct {
//
// +optional
// +oneOf=ConstraintType
// +k8s:optional
// +k8s:format=k8s-resource-fully-qualified-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"`
// Potential future extension, not part of the current design:
@ -1346,10 +1346,10 @@ type DeviceClaimConfiguration struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"`
@ -1363,7 +1363,7 @@ type DeviceConfiguration struct {
//
// +optional
// +oneOf=ConfigurationType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
}
@ -1380,9 +1380,9 @@ type OpaqueDeviceConfiguration struct {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:required
// +k8s:maxLength=63
// +k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
Driver string `json:"driver" protobuf:"bytes,1,name=driver"`
// Parameters can contain arbitrary data. It is the responsibility of
@ -1408,8 +1408,8 @@ type DeviceToleration struct {
// Must be a label name.
//
// +optional
// +k8s:optional
// +k8s:format=k8s-label-key
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"`
// Operator represents a key's relationship to the value.
@ -1419,7 +1419,7 @@ type DeviceToleration struct {
//
// +optional
// +default="Equal"
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"`
// Value is the taint value the toleration matches to.
@ -1433,7 +1433,7 @@ type DeviceToleration struct {
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"`
// TolerationSeconds represents the period of time the toleration (which must be
@ -1450,7 +1450,7 @@ type DeviceToleration struct {
// A toleration operator is the set of operators that can be used in a toleration.
//
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type DeviceTolerationOperator string
const (
@ -1464,8 +1464,8 @@ type ResourceClaimStatus struct {
// Allocation is set once the claim has been allocated successfully.
//
// +optional
// +k8s:optional
// +k8s:update=NoModify
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"`
// ReservedFor indicates which entities are currently allowed to use
@ -1493,10 +1493,10 @@ type ResourceClaimStatus struct {
// +listMapKey=uid
// +patchStrategy=merge
// +patchMergeKey=uid
// +k8s:optional
// +k8s:listType=map
// +k8s:listMapKey=uid
// +k8s:maxItems=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
// DeallocationRequested is tombstoned since Kubernetes 1.32 where
@ -1509,18 +1509,18 @@ type ResourceClaimStatus struct {
// information. Entries are owned by their respective drivers.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=map
// +listMapKey=driver
// +listMapKey=device
// +listMapKey=pool
// +listMapKey=shareID
// +featureGate=DRAResourceClaimDeviceStatus
// +k8s:listType=map
// +k8s:listMapKey=driver
// +k8s:listMapKey=device
// +k8s:listMapKey=pool
// +k8s:listMapKey=shareID
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
}
@ -1583,8 +1583,8 @@ type DeviceAllocationResult struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"`
// This field is a combination of all the claim and class configuration parameters.
@ -1597,8 +1597,8 @@ type DeviceAllocationResult struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=64
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
}
@ -1627,9 +1627,9 @@ type DeviceRequestAllocationResult struct {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:format=k8s-long-name-caseless
// +k8s:required
// +k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
Driver string `json:"driver" protobuf:"bytes,2,name=driver"`
// This name together with the driver name and the device name field
@ -1639,8 +1639,8 @@ type DeviceRequestAllocationResult struct {
// DNS sub-domains separated by slashes.
//
// +required
// +k8s:required
// +k8s:format=k8s-resource-pool-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
Pool string `json:"pool" protobuf:"bytes,3,name=pool"`
// Device references one device instance via its name in the driver's
@ -1672,8 +1672,8 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
// BindingConditions contains a copy of the BindingConditions
@ -1685,8 +1685,8 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"`
// BindingFailureConditions contains a copy of the BindingFailureConditions
@ -1698,8 +1698,8 @@ type DeviceRequestAllocationResult struct {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"`
// ShareID uniquely identifies an individual allocation share of the device,
@ -1709,8 +1709,8 @@ type DeviceRequestAllocationResult struct {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"`
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
@ -1734,7 +1734,7 @@ type DeviceAllocationConfiguration struct {
// or from a claim.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"`
// Requests lists the names of requests where the configuration applies.
@ -1746,17 +1746,17 @@ type DeviceAllocationConfiguration struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"`
DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"`
}
// +enum
// +k8s:enum
// +k8s:alpha(since: "1.36")=+k8s:enum
type AllocationConfigSource string
// Valid [DeviceAllocationConfiguration.Source] values.
@ -1795,8 +1795,8 @@ type DeviceClass struct {
metav1.TypeMeta `json:",inline"`
// Standard object metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines what can be allocated and how to configure it.
@ -1817,8 +1817,8 @@ type DeviceClassSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"`
// Config defines configuration parameters that apply to each device that is claimed via this class.
@ -1829,8 +1829,8 @@ type DeviceClassSpec struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
// SuitableNodes is tombstoned since Kubernetes 1.32 where
@ -1850,8 +1850,8 @@ type DeviceClassSpec struct {
// This is an alpha field.
// +optional
// +featureGate=DRAExtendedResource
// +k8s:optional
// +k8s:format=k8s-extended-resource-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"`
}
@ -1977,8 +1977,8 @@ type AllocatedDeviceStatus struct {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"`
// Conditions contains the latest observation of the device's state.
@ -2002,7 +2002,7 @@ type AllocatedDeviceStatus struct {
// NetworkData contains network-related information specific to the device.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"`
}
@ -2017,8 +2017,8 @@ type NetworkDeviceData struct {
// Must not be longer than 256 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=256
InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"`
// IPs lists the network addresses assigned to the device's network interface.
@ -2031,10 +2031,10 @@ type NetworkDeviceData struct {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"`
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
@ -2042,7 +2042,7 @@ type NetworkDeviceData struct {
// Must not be longer than 128 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=128
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=128
HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"`
}

View file

@ -65,8 +65,8 @@ message AllocatedDeviceStatus {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 7;
// Conditions contains the latest observation of the device's state.
@ -90,7 +90,7 @@ message AllocatedDeviceStatus {
// NetworkData contains network-related information specific to the device.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional NetworkDeviceData networkData = 6;
}
@ -307,8 +307,8 @@ message CounterSet {
// It must be a DNS label.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string name = 1;
// Counters defines the set of counters for this CounterSet
@ -317,8 +317,8 @@ message CounterSet {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -337,7 +337,7 @@ message Device {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
map<string, DeviceAttribute> attributes = 2;
// Capacity defines the set of capacities for this device.
@ -358,13 +358,13 @@ message Device {
// device is 2.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=counterSet
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
// +featureGate=DRAPartitionableDevices
// +k8s:maxItems=2
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
repeated DeviceCounterConsumption consumesCounters = 4;
// NodeName identifies the node where the device is available.
@ -411,7 +411,7 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceTaint taints = 8;
// BindsToNode indicates if the usage of an allocation involving this device
@ -441,8 +441,8 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 10;
// BindingFailureConditions defines the conditions for binding failure.
@ -459,8 +459,8 @@ message Device {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 11;
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
@ -480,7 +480,7 @@ message DeviceAllocationConfiguration {
// or from a claim.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string source = 1;
// Requests lists the names of requests where the configuration applies.
@ -492,10 +492,10 @@ message DeviceAllocationConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 2;
optional DeviceConfiguration deviceConfiguration = 3;
@ -507,8 +507,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequestAllocationResult results = 1;
// This field is a combination of all the claim and class configuration parameters.
@ -521,8 +521,8 @@ message DeviceAllocationResult {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=64
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
repeated DeviceAllocationConfiguration config = 2;
}
@ -531,30 +531,30 @@ message DeviceAttribute {
// IntValue is a number.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional int64 int = 2;
// BoolValue is a true/false value.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional bool bool = 3;
// StringValue is a string. Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string string = 4;
// VersionValue is a semantic version according to semver.org spec 2.0.0.
// Must not be longer than 64 characters.
//
// +optional
// +k8s:optional
// +k8s:unionMember
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:unionMember
optional string version = 5;
}
@ -591,11 +591,11 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceRequest requests = 1;
// These constraints must be satisfied by the set of devices that get
@ -603,8 +603,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceConstraint constraints = 2;
// This field holds configuration for multiple potential drivers which
@ -613,8 +613,8 @@ message DeviceClaim {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClaimConfiguration config = 3;
}
@ -629,10 +629,10 @@ message DeviceClaimConfiguration {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
optional DeviceConfiguration deviceConfiguration = 2;
@ -648,8 +648,8 @@ message DeviceClaimConfiguration {
message DeviceClass {
// Standard object metadata
// +optional
// +k8s:subfield(name)=+k8s:optional
// +k8s:subfield(name)=+k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines what can be allocated and how to configure it.
@ -685,8 +685,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 1;
// Config defines configuration parameters that apply to each device that is claimed via this class.
@ -697,8 +697,8 @@ message DeviceClassSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceClassConfiguration config = 2;
// ExtendedResourceName is the extended resource name for the devices of this class.
@ -713,8 +713,8 @@ message DeviceClassSpec {
// This is an alpha field.
// +optional
// +featureGate=DRAExtendedResource
// +k8s:optional
// +k8s:format=k8s-extended-resource-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
optional string extendedResourceName = 4;
}
@ -726,7 +726,7 @@ message DeviceConfiguration {
//
// +optional
// +oneOf=ConfigurationType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional OpaqueDeviceConfiguration opaque = 1;
}
@ -744,10 +744,10 @@ message DeviceConstraint {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated string requests = 1;
// MatchAttribute requires that all devices in question have this
@ -765,8 +765,8 @@ message DeviceConstraint {
//
// +optional
// +oneOf=ConstraintType
// +k8s:optional
// +k8s:format=k8s-resource-fully-qualified-name
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
optional string matchAttribute = 2;
// DistinctAttribute requires that all devices in question have this
@ -793,8 +793,8 @@ message DeviceCounterConsumption {
// counters defined will be consumed.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
optional string counterSet = 1;
// Counters defines the counters that will be consumed by the device.
@ -802,8 +802,8 @@ message DeviceCounterConsumption {
// The maximum number of counters is 32.
//
// +required
// +k8s:required
// +k8s:eachKey=+k8s:format=k8s-short-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
map<string, Counter> counters = 2;
}
@ -833,7 +833,7 @@ message DeviceRequest {
//
// +optional
// +oneOf=deviceRequestType
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional ExactDeviceRequest exactly = 2;
// FirstAvailable contains subrequests, of which exactly one will be
@ -854,11 +854,11 @@ message DeviceRequest {
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated DeviceSubRequest firstAvailable = 3;
}
@ -883,9 +883,9 @@ message DeviceRequestAllocationResult {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:format=k8s-long-name-caseless
// +k8s:maxLength=63
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:required
optional string driver = 2;
// This name together with the driver name and the device name field
@ -895,8 +895,8 @@ message DeviceRequestAllocationResult {
// DNS sub-domains separated by slashes.
//
// +required
// +k8s:required
// +k8s:format=k8s-resource-pool-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
optional string pool = 3;
// Device references one device instance via its name in the driver's
@ -928,7 +928,7 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// BindingConditions contains a copy of the BindingConditions
@ -940,8 +940,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingConditions = 7;
// BindingFailureConditions contains a copy of the BindingFailureConditions
@ -953,8 +953,8 @@ message DeviceRequestAllocationResult {
// +optional
// +listType=atomic
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
// +k8s:optional
// +k8s:maxItems=4
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
repeated string bindingFailureConditions = 8;
// ShareID uniquely identifies an individual allocation share of the device,
@ -964,8 +964,8 @@ message DeviceRequestAllocationResult {
//
// +optional
// +featureGate=DRAConsumableCapacity
// +k8s:optional
// +k8s:format=k8s-uuid
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
optional string shareID = 9;
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
@ -1022,8 +1022,8 @@ message DeviceSubRequest {
// to reference.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
optional string deviceClassName = 2;
// Selectors define criteria which must be satisfied by a specific
@ -1033,8 +1033,8 @@ message DeviceSubRequest {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 3;
// AllocationMode and its related fields define how devices are allocated
@ -1056,7 +1056,7 @@ message DeviceSubRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 4;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1087,7 +1087,7 @@ message DeviceSubRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// Capacity define resource requirements against each capacity.
@ -1134,7 +1134,7 @@ message DeviceTaint {
// Consumers must treat unknown effects like None.
//
// +required
// +k8s:required
// +k8s:alpha(since: "1.36")=+k8s:required
optional string effect = 3;
// TimeAdded represents the time at which the taint was added.
@ -1152,8 +1152,8 @@ message DeviceToleration {
// Must be a label name.
//
// +optional
// +k8s:optional
// +k8s:format=k8s-label-key
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
optional string key = 1;
// Operator represents a key's relationship to the value.
@ -1163,7 +1163,7 @@ message DeviceToleration {
//
// +optional
// +default="Equal"
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string operator = 2;
// Value is the taint value the toleration matches to.
@ -1177,7 +1177,7 @@ message DeviceToleration {
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string effect = 4;
// TolerationSeconds represents the period of time the toleration (which must be
@ -1215,8 +1215,8 @@ message ExactDeviceRequest {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:maxItems=32
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
repeated DeviceSelector selectors = 2;
// AllocationMode and its related fields define how devices are allocated
@ -1239,7 +1239,7 @@ message ExactDeviceRequest {
// requests with unknown modes.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
optional string allocationMode = 3;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
@ -1284,7 +1284,7 @@ message ExactDeviceRequest {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
repeated DeviceToleration tolerations = 6;
// Capacity define resource requirements against each capacity.
@ -1316,8 +1316,8 @@ message NetworkDeviceData {
// Must not be longer than 256 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=256
optional string interfaceName = 1;
// IPs lists the network addresses assigned to the device's network interface.
@ -1328,10 +1328,10 @@ message NetworkDeviceData {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:listType=atomic
// +k8s:unique=set
// +k8s:maxItems=16
// +k8s:alpha(since: "1.36")=+k8s:unique=set
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
repeated string ips = 2;
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
@ -1339,8 +1339,8 @@ message NetworkDeviceData {
// Must not be longer than 128 characters.
//
// +optional
// +k8s:optional
// +k8s:maxLength=128
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:maxLength=128
optional string hardwareAddress = 3;
}
@ -1357,9 +1357,9 @@ message OpaqueDeviceConfiguration {
// vendor of the driver. It should use only lower case characters.
//
// +required
// +k8s:required
// +k8s:maxLength=63
// +k8s:format=k8s-long-name-caseless
// +k8s:alpha(since: "1.36")=+k8s:required
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
optional string driver = 1;
// Parameters can contain arbitrary data. It is the responsibility of
@ -1388,7 +1388,7 @@ message ResourceClaim {
// Spec describes what is being requested and how to configure it.
// The spec is immutable.
// +k8s:immutable
// +k8s:alpha(since: "1.36")=+k8s:immutable
optional ResourceClaimSpec spec = 2;
// Status describes whether the claim is ready to use and what has been allocated.
@ -1443,8 +1443,8 @@ message ResourceClaimStatus {
// Allocation is set once the claim has been allocated successfully.
//
// +optional
// +k8s:optional
// +k8s:update=NoModify
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
optional AllocationResult allocation = 1;
// ReservedFor indicates which entities are currently allowed to use
@ -1472,10 +1472,10 @@ message ResourceClaimStatus {
// +listMapKey=uid
// +patchStrategy=merge
// +patchMergeKey=uid
// +k8s:optional
// +k8s:listType=map
// +k8s:listMapKey=uid
// +k8s:maxItems=256
// +k8s:alpha(since: "1.36")=+k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
repeated ResourceClaimConsumerReference reservedFor = 2;
// Devices contains the status of each device allocated for this
@ -1483,18 +1483,18 @@ message ResourceClaimStatus {
// information. Entries are owned by their respective drivers.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=map
// +listMapKey=driver
// +listMapKey=device
// +listMapKey=pool
// +listMapKey=shareID
// +featureGate=DRAResourceClaimDeviceStatus
// +k8s:listType=map
// +k8s:listMapKey=driver
// +k8s:listMapKey=device
// +k8s:listMapKey=pool
// +k8s:listMapKey=shareID
// +k8s:alpha(since: "1.36")=+k8s:listType=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
repeated AllocatedDeviceStatus devices = 4;
}
@ -1683,7 +1683,7 @@ message ResourceSliceSpec {
//
// +optional
// +listType=atomic
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +zeroOrOneOf=ResourceSliceType
repeated Device devices = 6;
@ -1709,14 +1709,14 @@ message ResourceSliceSpec {
// The maximum number of counter sets is 8.
//
// +optional
// +k8s:optional
// +k8s:alpha(since: "1.36")=+k8s:optional
// +listType=atomic
// +k8s:listType=atomic
// +k8s:unique=map
// +k8s:listMapKey=name
// +k8s:alpha(since: "1.36")=+k8s:unique=map
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
// +featureGate=DRAPartitionableDevices
// +zeroOrOneOf=ResourceSliceType
// +k8s:maxItems=8
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
repeated CounterSet sharedCounters = 8;
}

Some files were not shown because too many files have changed in this diff Show more