mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 18:37:15 +00:00
Add WarningsOnCreate,WarningsOnUpdate
This commit is contained in:
@@ -65,6 +65,9 @@ func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorLis
|
||||
return validation.ValidateControllerRevision(revision)
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (strategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { return nil }
|
||||
|
||||
func (strategy) PrepareForUpdate(ctx context.Context, newObj, oldObj runtime.Object) {
|
||||
_ = oldObj.(*apps.ControllerRevision)
|
||||
_ = newObj.(*apps.ControllerRevision)
|
||||
@@ -78,3 +81,6 @@ func (strategy) ValidateUpdate(ctx context.Context, newObj, oldObj runtime.Objec
|
||||
oldRevision, newRevision := oldObj.(*apps.ControllerRevision), newObj.(*apps.ControllerRevision)
|
||||
return validation.ValidateControllerRevisionUpdate(newRevision, oldRevision)
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (strategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { return nil }
|
||||
|
@@ -166,6 +166,11 @@ func (daemonSetStrategy) Validate(ctx context.Context, obj runtime.Object) field
|
||||
return validation.ValidateDaemonSet(daemonSet, opts)
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (daemonSetStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (daemonSetStrategy) Canonicalize(obj runtime.Object) {
|
||||
}
|
||||
@@ -203,6 +208,11 @@ func (daemonSetStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Ob
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (daemonSetStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AllowUnconditionalUpdate is the default update policy for daemon set objects.
|
||||
func (daemonSetStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
@@ -234,3 +244,8 @@ func (daemonSetStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old ru
|
||||
func (daemonSetStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||
return validation.ValidateDaemonSetStatusUpdate(obj.(*apps.DaemonSet), old.(*apps.DaemonSet))
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (daemonSetStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
@@ -96,6 +96,11 @@ func (deploymentStrategy) Validate(ctx context.Context, obj runtime.Object) fiel
|
||||
return validation.ValidateDeployment(deployment, opts)
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (deploymentStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (deploymentStrategy) Canonicalize(obj runtime.Object) {
|
||||
}
|
||||
@@ -149,6 +154,11 @@ func (deploymentStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.O
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (deploymentStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (deploymentStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
}
|
||||
@@ -183,3 +193,8 @@ func (deploymentStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old r
|
||||
func (deploymentStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||
return validation.ValidateDeploymentStatusUpdate(obj.(*apps.Deployment), old.(*apps.Deployment))
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (deploymentStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
@@ -125,6 +125,9 @@ func (rsStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorL
|
||||
return validation.ValidateReplicaSet(rs, opts)
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (rsStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { return nil }
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (rsStrategy) Canonicalize(obj runtime.Object) {
|
||||
}
|
||||
@@ -162,6 +165,9 @@ func (rsStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) f
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (rsStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { return nil }
|
||||
|
||||
func (rsStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
}
|
||||
@@ -222,3 +228,8 @@ func (rsStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.O
|
||||
func (rsStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||
return validation.ValidateReplicaSetStatusUpdate(obj.(*apps.ReplicaSet), old.(*apps.ReplicaSet))
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (rsStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
@@ -113,6 +113,11 @@ func (statefulSetStrategy) Validate(ctx context.Context, obj runtime.Object) fie
|
||||
return validation.ValidateStatefulSet(statefulSet, opts)
|
||||
}
|
||||
|
||||
// WarningsOnCreate returns warnings for the creation of the given object.
|
||||
func (statefulSetStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Canonicalize normalizes the object after validation.
|
||||
func (statefulSetStrategy) Canonicalize(obj runtime.Object) {
|
||||
}
|
||||
@@ -133,6 +138,11 @@ func (statefulSetStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.
|
||||
return append(validationErrorList, updateErrorList...)
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (statefulSetStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AllowUnconditionalUpdate is the default update policy for StatefulSet objects.
|
||||
func (statefulSetStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
@@ -168,3 +178,8 @@ func (statefulSetStatusStrategy) ValidateUpdate(ctx context.Context, obj, old ru
|
||||
// TODO: Validate status updates.
|
||||
return validation.ValidateStatefulSetStatusUpdate(obj.(*apps.StatefulSet), old.(*apps.StatefulSet))
|
||||
}
|
||||
|
||||
// WarningsOnUpdate returns warnings for the given update.
|
||||
func (statefulSetStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user