mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Relax validation for CSIVolumeFSGroupPolicy
This commit is contained in:
parent
6d5cb36d36
commit
6b9348e878
@ -404,7 +404,7 @@ func ValidateCSIDriver(csiDriver *storage.CSIDriver) field.ErrorList {
|
|||||||
|
|
||||||
// ValidateCSIDriverUpdate validates a CSIDriver.
|
// ValidateCSIDriverUpdate validates a CSIDriver.
|
||||||
func ValidateCSIDriverUpdate(new, old *storage.CSIDriver) field.ErrorList {
|
func ValidateCSIDriverUpdate(new, old *storage.CSIDriver) field.ErrorList {
|
||||||
allErrs := ValidateCSIDriver(new)
|
allErrs := apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))
|
||||||
|
|
||||||
// Spec is read-only
|
// Spec is read-only
|
||||||
// If this ever relaxes in the future, make sure to increment the Generation number in PrepareForUpdate
|
// If this ever relaxes in the future, make sure to increment the Generation number in PrepareForUpdate
|
||||||
|
@ -1869,9 +1869,13 @@ func TestCSIDriverValidationUpdate(t *testing.T) {
|
|||||||
attachNotRequired := false
|
attachNotRequired := false
|
||||||
podInfoOnMount := true
|
podInfoOnMount := true
|
||||||
notPodInfoOnMount := false
|
notPodInfoOnMount := false
|
||||||
|
<<<<<<< HEAD
|
||||||
notRequiresRepublish := false
|
notRequiresRepublish := false
|
||||||
|
=======
|
||||||
|
resourceVersion := "1"
|
||||||
|
>>>>>>> Relax validation for CSIVolumeFSGroupPolicy
|
||||||
old := storage.CSIDriver{
|
old := storage.CSIDriver{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: driverName},
|
ObjectMeta: metav1.ObjectMeta{Name: driverName, ResourceVersion: resourceVersion},
|
||||||
Spec: storage.CSIDriverSpec{
|
Spec: storage.CSIDriverSpec{
|
||||||
AttachRequired: &attachNotRequired,
|
AttachRequired: &attachNotRequired,
|
||||||
PodInfoOnMount: ¬PodInfoOnMount,
|
PodInfoOnMount: ¬PodInfoOnMount,
|
||||||
|
@ -113,8 +113,7 @@ func (csiDriverStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.
|
|||||||
func (csiDriverStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
func (csiDriverStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||||
newCSIDriverObj := obj.(*storage.CSIDriver)
|
newCSIDriverObj := obj.(*storage.CSIDriver)
|
||||||
oldCSIDriverObj := old.(*storage.CSIDriver)
|
oldCSIDriverObj := old.(*storage.CSIDriver)
|
||||||
errorList := validation.ValidateCSIDriver(newCSIDriverObj)
|
return validation.ValidateCSIDriverUpdate(newCSIDriverObj, oldCSIDriverObj)
|
||||||
return append(errorList, validation.ValidateCSIDriverUpdate(newCSIDriverObj, oldCSIDriverObj)...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csiDriverStrategy) AllowUnconditionalUpdate() bool {
|
func (csiDriverStrategy) AllowUnconditionalUpdate() bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user