Skip to content

Commit

Permalink
Implement Reject Invalid PVC DataSource KEP
Browse files Browse the repository at this point in the history
Instead of ignoring invalid PVC data sources, reject them
  • Loading branch information
bswartz committed May 11, 2021
1 parent 2112bdd commit 1e4f1e0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 313 deletions.
5 changes: 0 additions & 5 deletions pkg/api/persistentvolumeclaim/OWNERS

This file was deleted.

69 changes: 0 additions & 69 deletions pkg/api/persistentvolumeclaim/util.go

This file was deleted.

234 changes: 0 additions & 234 deletions pkg/api/persistentvolumeclaim/util_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions pkg/registry/core/persistentvolumeclaim/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"k8s.io/apiserver/pkg/storage/names"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/api/legacyscheme"
pvcutil "k8s.io/kubernetes/pkg/api/persistentvolumeclaim"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/validation"
"k8s.io/kubernetes/pkg/features"
Expand Down Expand Up @@ -66,8 +65,6 @@ func (persistentvolumeclaimStrategy) GetResetFields() map[fieldpath.APIVersion]*
func (persistentvolumeclaimStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
pvc := obj.(*api.PersistentVolumeClaim)
pvc.Status = api.PersistentVolumeClaimStatus{}

pvcutil.DropDisabledFields(&pvc.Spec, nil)
}

func (persistentvolumeclaimStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
Expand All @@ -88,8 +85,6 @@ func (persistentvolumeclaimStrategy) PrepareForUpdate(ctx context.Context, obj,
newPvc := obj.(*api.PersistentVolumeClaim)
oldPvc := old.(*api.PersistentVolumeClaim)
newPvc.Status = oldPvc.Status

pvcutil.DropDisabledFields(&newPvc.Spec, &oldPvc.Spec)
}

func (persistentvolumeclaimStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
Expand Down

0 comments on commit 1e4f1e0

Please sign in to comment.