mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-14 20:10:50 -04:00
548 lines
19 KiB
Go
Generated
548 lines
19 KiB
Go
Generated
//go:build !ignore_autogenerated
|
|
// +build !ignore_autogenerated
|
|
|
|
/*
|
|
Copyright The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Code generated by validation-gen. DO NOT EDIT.
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
equality "k8s.io/apimachinery/pkg/api/equality"
|
|
operation "k8s.io/apimachinery/pkg/api/operation"
|
|
safe "k8s.io/apimachinery/pkg/api/safe"
|
|
validate "k8s.io/apimachinery/pkg/api/validate"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
|
field "k8s.io/apimachinery/pkg/util/validation/field"
|
|
)
|
|
|
|
func init() { localSchemeBuilder.Register(RegisterValidations) }
|
|
|
|
// RegisterValidations adds validation functions to the given scheme.
|
|
// Public to allow building arbitrary schemes.
|
|
func RegisterValidations(scheme *runtime.Scheme) error {
|
|
// type Pod
|
|
scheme.AddValidationFunc(
|
|
(*corev1.Pod)(nil),
|
|
func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
|
|
switch op.Request.SubresourcePath() {
|
|
case "/", "/ephemeralcontainers", "/eviction", "/resize", "/status":
|
|
return Validate_Pod(
|
|
ctx, op, nil, /* fldPath */
|
|
obj.(*corev1.Pod),
|
|
safe.Cast[*corev1.Pod](oldObj))
|
|
}
|
|
return field.ErrorList{
|
|
field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath())),
|
|
}
|
|
})
|
|
// type PodTemplate
|
|
scheme.AddValidationFunc(
|
|
(*corev1.PodTemplate)(nil),
|
|
func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
|
|
switch op.Request.SubresourcePath() {
|
|
case "/":
|
|
return Validate_PodTemplate(
|
|
ctx, op, nil, /* fldPath */
|
|
obj.(*corev1.PodTemplate),
|
|
safe.Cast[*corev1.PodTemplate](oldObj))
|
|
}
|
|
return field.ErrorList{
|
|
field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath())),
|
|
}
|
|
})
|
|
// type ReplicationController
|
|
scheme.AddValidationFunc(
|
|
(*corev1.ReplicationController)(nil),
|
|
func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
|
|
switch op.Request.SubresourcePath() {
|
|
case "/", "/scale", "/status":
|
|
return Validate_ReplicationController(
|
|
ctx, op, nil, /* fldPath */
|
|
obj.(*corev1.ReplicationController),
|
|
safe.Cast[*corev1.ReplicationController](oldObj))
|
|
}
|
|
return field.ErrorList{
|
|
field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath())),
|
|
}
|
|
})
|
|
// type Secret
|
|
scheme.AddValidationFunc(
|
|
(*corev1.Secret)(nil),
|
|
func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
|
|
switch op.Request.SubresourcePath() {
|
|
case "/":
|
|
return Validate_Secret(
|
|
ctx, op, nil, /* fldPath */
|
|
obj.(*corev1.Secret),
|
|
safe.Cast[*corev1.Secret](oldObj))
|
|
}
|
|
return field.ErrorList{
|
|
field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath())),
|
|
}
|
|
})
|
|
return nil
|
|
}
|
|
|
|
// Validate_Pod validates an instance of Pod according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_Pod(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.Pod) (errs field.ErrorList) {
|
|
|
|
// field corev1.Pod.TypeMeta has no validation
|
|
// field corev1.Pod.ObjectMeta has no validation
|
|
|
|
{ // field corev1.Pod.Spec
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.PodSpec,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call the type's validation function
|
|
errs = append(errs, Validate_PodSpec(ctx, op, fldPath, obj, oldObj)...)
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.Pod) *corev1.PodSpec {
|
|
return &oldObj.Spec
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
// field corev1.Pod.Status has no validation
|
|
return errs
|
|
}
|
|
|
|
// Validate_PodSpec validates an instance of PodSpec according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_PodSpec(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.PodSpec) (errs field.ErrorList) {
|
|
|
|
// field corev1.PodSpec.Volumes has no validation
|
|
// field corev1.PodSpec.InitContainers has no validation
|
|
// field corev1.PodSpec.Containers has no validation
|
|
// field corev1.PodSpec.EphemeralContainers has no validation
|
|
// field corev1.PodSpec.RestartPolicy has no validation
|
|
// field corev1.PodSpec.TerminationGracePeriodSeconds has no validation
|
|
// field corev1.PodSpec.ActiveDeadlineSeconds has no validation
|
|
// field corev1.PodSpec.DNSPolicy has no validation
|
|
// field corev1.PodSpec.NodeSelector has no validation
|
|
// field corev1.PodSpec.ServiceAccountName has no validation
|
|
// field corev1.PodSpec.DeprecatedServiceAccount has no validation
|
|
// field corev1.PodSpec.AutomountServiceAccountToken has no validation
|
|
// field corev1.PodSpec.NodeName has no validation
|
|
// field corev1.PodSpec.HostNetwork has no validation
|
|
// field corev1.PodSpec.HostPID has no validation
|
|
// field corev1.PodSpec.HostIPC has no validation
|
|
// field corev1.PodSpec.ShareProcessNamespace has no validation
|
|
// field corev1.PodSpec.SecurityContext has no validation
|
|
// field corev1.PodSpec.ImagePullSecrets has no validation
|
|
// field corev1.PodSpec.Hostname has no validation
|
|
// field corev1.PodSpec.Subdomain has no validation
|
|
// field corev1.PodSpec.Affinity has no validation
|
|
// field corev1.PodSpec.SchedulerName has no validation
|
|
|
|
{ // field corev1.PodSpec.Tolerations
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj []corev1.Toleration,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
earlyReturn := false
|
|
if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
// iterate the list and call the type's validation function
|
|
if e := validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_Toleration); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
}
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.PodSpec) []corev1.Toleration {
|
|
return oldObj.Tolerations
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("tolerations"), obj.Tolerations, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
// field corev1.PodSpec.HostAliases has no validation
|
|
// field corev1.PodSpec.PriorityClassName has no validation
|
|
// field corev1.PodSpec.Priority has no validation
|
|
// field corev1.PodSpec.DNSConfig has no validation
|
|
// field corev1.PodSpec.ReadinessGates has no validation
|
|
// field corev1.PodSpec.RuntimeClassName has no validation
|
|
// field corev1.PodSpec.EnableServiceLinks has no validation
|
|
// field corev1.PodSpec.PreemptionPolicy has no validation
|
|
// field corev1.PodSpec.Overhead has no validation
|
|
// field corev1.PodSpec.TopologySpreadConstraints has no validation
|
|
// field corev1.PodSpec.SetHostnameAsFQDN has no validation
|
|
// field corev1.PodSpec.OS has no validation
|
|
// field corev1.PodSpec.HostUsers has no validation
|
|
// field corev1.PodSpec.SchedulingGates has no validation
|
|
// field corev1.PodSpec.ResourceClaims has no validation
|
|
// field corev1.PodSpec.Resources has no validation
|
|
// field corev1.PodSpec.HostnameOverride has no validation
|
|
// field corev1.PodSpec.SchedulingGroup has no validation
|
|
return errs
|
|
}
|
|
|
|
// Validate_PodTemplate validates an instance of PodTemplate according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_PodTemplate(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.PodTemplate) (errs field.ErrorList) {
|
|
|
|
// field corev1.PodTemplate.TypeMeta has no validation
|
|
// field corev1.PodTemplate.ObjectMeta has no validation
|
|
|
|
{ // field corev1.PodTemplate.Template
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.PodTemplateSpec,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call the type's validation function
|
|
errs = append(errs, Validate_PodTemplateSpec(ctx, op, fldPath, obj, oldObj)...)
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.PodTemplate) *corev1.PodTemplateSpec {
|
|
return &oldObj.Template
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("template"), &obj.Template, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// Validate_PodTemplateSpec validates an instance of PodTemplateSpec according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_PodTemplateSpec(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.PodTemplateSpec) (errs field.ErrorList) {
|
|
|
|
// field corev1.PodTemplateSpec.ObjectMeta has no validation
|
|
|
|
{ // field corev1.PodTemplateSpec.Spec
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.PodSpec,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call the type's validation function
|
|
errs = append(errs, Validate_PodSpec(ctx, op, fldPath, obj, oldObj)...)
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.PodTemplateSpec) *corev1.PodSpec {
|
|
return &oldObj.Spec
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// Validate_ReplicationController validates an instance of ReplicationController according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_ReplicationController(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.ReplicationController) (errs field.ErrorList) {
|
|
|
|
// field corev1.ReplicationController.TypeMeta has no validation
|
|
|
|
{ // field corev1.ReplicationController.ObjectMeta
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *metav1.ObjectMeta,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// 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).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
if e := validate.Subfield(ctx, op, fldPath, obj, oldObj, "name",
|
|
func(o *metav1.ObjectMeta) *string { return &o.Name }, validate.DirectEqualPtr, validate.LongName).MarkAlpha(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
}
|
|
}()
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.ReplicationController) *metav1.ObjectMeta {
|
|
return &oldObj.ObjectMeta
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
{ // field corev1.ReplicationController.Spec
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.ReplicationControllerSpec,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call the type's validation function
|
|
errs = append(errs, Validate_ReplicationControllerSpec(ctx, op, fldPath, obj, oldObj)...)
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.ReplicationController) *corev1.ReplicationControllerSpec {
|
|
return &oldObj.Spec
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
// field corev1.ReplicationController.Status has no validation
|
|
return errs
|
|
}
|
|
|
|
// Validate_ReplicationControllerSpec validates an instance of ReplicationControllerSpec according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_ReplicationControllerSpec(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.ReplicationControllerSpec) (errs field.ErrorList) {
|
|
|
|
{ // field corev1.ReplicationControllerSpec.Replicas
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *int32,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
earlyReturn := false
|
|
// optional fields with default values are effectively required
|
|
if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
}
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.ReplicationControllerSpec) *int32 {
|
|
return oldObj.Replicas
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("replicas"), obj.Replicas, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
{ // field corev1.ReplicationControllerSpec.MinReadySeconds
|
|
fn := 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 {
|
|
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
}
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.ReplicationControllerSpec) *int32 {
|
|
return &oldObj.MinReadySeconds
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("minReadySeconds"), &obj.MinReadySeconds, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
// field corev1.ReplicationControllerSpec.Selector has no validation
|
|
|
|
{ // field corev1.ReplicationControllerSpec.Template
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.PodTemplateSpec,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if equality.Semantic.DeepEqual(obj, oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
earlyReturn := false
|
|
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
// call the type's validation function
|
|
errs = append(errs, Validate_PodTemplateSpec(ctx, op, fldPath, obj, oldObj)...)
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.ReplicationControllerSpec) *corev1.PodTemplateSpec {
|
|
return oldObj.Template
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("template"), obj.Template, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// Validate_Secret validates an instance of Secret according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_Secret(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.Secret) (errs field.ErrorList) {
|
|
|
|
// field corev1.Secret.TypeMeta has no validation
|
|
// field corev1.Secret.ObjectMeta has no validation
|
|
// field corev1.Secret.Immutable has no validation
|
|
// field corev1.Secret.Data has no validation
|
|
// field corev1.Secret.StringData has no validation
|
|
|
|
{ // field corev1.Secret.Type
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *corev1.SecretType,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
earlyReturn := false
|
|
if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
earlyReturn = true
|
|
}
|
|
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.Secret) *corev1.SecretType {
|
|
return &oldObj.Type
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("type"), &obj.Type, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// Validate_Toleration validates an instance of Toleration according
|
|
// to declarative validation rules in the API schema.
|
|
func Validate_Toleration(
|
|
ctx context.Context, op operation.Operation, fldPath *field.Path,
|
|
obj, oldObj *corev1.Toleration) (errs field.ErrorList) {
|
|
|
|
{ // field corev1.Toleration.Key
|
|
fn := func(
|
|
fldPath *field.Path,
|
|
obj, oldObj *string,
|
|
oldValueCorrelated bool) (errs field.ErrorList) {
|
|
// don't revalidate unchanged data
|
|
if oldValueCorrelated && op.Type == operation.Update {
|
|
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
|
|
return nil
|
|
}
|
|
}
|
|
// call field-attached validations
|
|
earlyReturn := false
|
|
if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
|
|
earlyReturn = true
|
|
}
|
|
if earlyReturn {
|
|
return // do not proceed
|
|
}
|
|
if e := validate.LabelKey(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 {
|
|
errs = append(errs, e...)
|
|
}
|
|
return
|
|
}
|
|
oldVal := safe.Field(oldObj,
|
|
func(oldObj *corev1.Toleration) *string {
|
|
return &oldObj.Key
|
|
})
|
|
errs = append(errs, fn(fldPath.Child("key"), &obj.Key, oldVal, oldObj != nil)...)
|
|
}
|
|
|
|
// field corev1.Toleration.Operator has no validation
|
|
// field corev1.Toleration.Value has no validation
|
|
// field corev1.Toleration.Effect has no validation
|
|
// field corev1.Toleration.TolerationSeconds has no validation
|
|
return errs
|
|
}
|