mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 09:57:52 +00:00
Pass pod annotations into DropDisabledFields()
This commit is contained in:
@@ -75,7 +75,7 @@ func (daemonSetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Objec
|
||||
daemonSet.Spec.TemplateGeneration = 1
|
||||
}
|
||||
|
||||
pod.DropDisabledFields(&daemonSet.Spec.Template.Spec, nil)
|
||||
pod.DropDisabledTemplateFields(&daemonSet.Spec.Template, nil)
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
@@ -83,7 +83,7 @@ func (daemonSetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.
|
||||
newDaemonSet := obj.(*apps.DaemonSet)
|
||||
oldDaemonSet := old.(*apps.DaemonSet)
|
||||
|
||||
pod.DropDisabledFields(&newDaemonSet.Spec.Template.Spec, &oldDaemonSet.Spec.Template.Spec)
|
||||
pod.DropDisabledTemplateFields(&newDaemonSet.Spec.Template, &oldDaemonSet.Spec.Template)
|
||||
|
||||
// update is not allowed to set status
|
||||
newDaemonSet.Status = oldDaemonSet.Status
|
||||
|
@@ -73,7 +73,7 @@ func (deploymentStrategy) PrepareForCreate(ctx context.Context, obj runtime.Obje
|
||||
deployment.Status = apps.DeploymentStatus{}
|
||||
deployment.Generation = 1
|
||||
|
||||
pod.DropDisabledFields(&deployment.Spec.Template.Spec, nil)
|
||||
pod.DropDisabledTemplateFields(&deployment.Spec.Template, nil)
|
||||
}
|
||||
|
||||
// Validate validates a new deployment.
|
||||
@@ -97,7 +97,7 @@ func (deploymentStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime
|
||||
oldDeployment := old.(*apps.Deployment)
|
||||
newDeployment.Status = oldDeployment.Status
|
||||
|
||||
pod.DropDisabledFields(&newDeployment.Spec.Template.Spec, &oldDeployment.Spec.Template.Spec)
|
||||
pod.DropDisabledTemplateFields(&newDeployment.Spec.Template, &oldDeployment.Spec.Template)
|
||||
|
||||
// Spec updates bump the generation so that we can distinguish between
|
||||
// scaling events and template changes, annotation updates bump the generation
|
||||
|
@@ -80,7 +80,7 @@ func (rsStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
|
||||
|
||||
rs.Generation = 1
|
||||
|
||||
pod.DropDisabledFields(&rs.Spec.Template.Spec, nil)
|
||||
pod.DropDisabledTemplateFields(&rs.Spec.Template, nil)
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
@@ -90,7 +90,7 @@ func (rsStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
|
||||
// update is not allowed to set status
|
||||
newRS.Status = oldRS.Status
|
||||
|
||||
pod.DropDisabledFields(&newRS.Spec.Template.Spec, &oldRS.Spec.Template.Spec)
|
||||
pod.DropDisabledTemplateFields(&newRS.Spec.Template, &oldRS.Spec.Template)
|
||||
|
||||
// Any changes to the spec increment the generation number, any changes to the
|
||||
// status should reflect the generation number of the corresponding object. We push
|
||||
|
@@ -72,7 +72,7 @@ func (statefulSetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Obj
|
||||
|
||||
statefulSet.Generation = 1
|
||||
|
||||
pod.DropDisabledFields(&statefulSet.Spec.Template.Spec, nil)
|
||||
pod.DropDisabledTemplateFields(&statefulSet.Spec.Template, nil)
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
@@ -82,7 +82,7 @@ func (statefulSetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtim
|
||||
// Update is not allowed to set status
|
||||
newStatefulSet.Status = oldStatefulSet.Status
|
||||
|
||||
pod.DropDisabledFields(&newStatefulSet.Spec.Template.Spec, &oldStatefulSet.Spec.Template.Spec)
|
||||
pod.DropDisabledTemplateFields(&newStatefulSet.Spec.Template, &oldStatefulSet.Spec.Template)
|
||||
|
||||
// Any changes to the spec increment the generation number, any changes to the
|
||||
// status should reflect the generation number of the corresponding object.
|
||||
|
Reference in New Issue
Block a user