Skip to content

Commit e865c0b

Browse files
authored
Merge pull request kubernetes#88686 from j-griffith/upgrade_cloning_to_ga
Mark PVCDataSource featuregate as GA
2 parents 5c5faed + 9044fbf commit e865c0b

File tree

8 files changed

+35
-55
lines changed

8 files changed

+35
-55
lines changed

api/openapi-spec/swagger.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/persistentvolumeclaim/util.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ func dataSourceIsEnabled(pvcSpec *core.PersistentVolumeClaimSpec) bool {
5151
if pvcSpec.DataSource.APIGroup != nil {
5252
apiGroup = *pvcSpec.DataSource.APIGroup
5353
}
54-
if utilfeature.DefaultFeatureGate.Enabled(features.VolumePVCDataSource) &&
55-
pvcSpec.DataSource.Kind == pvc &&
54+
if pvcSpec.DataSource.Kind == pvc &&
5655
apiGroup == "" {
5756
return true
5857

pkg/api/persistentvolumeclaim/util_test.go

+11-37
Original file line numberDiff line numberDiff line change
@@ -148,58 +148,32 @@ func TestPVCDataSourceSpecFilter(t *testing.T) {
148148
}
149149

150150
var tests = map[string]struct {
151-
spec core.PersistentVolumeClaimSpec
152-
gateEnabled bool
153-
want *core.TypedLocalObjectReference
151+
spec core.PersistentVolumeClaimSpec
152+
want *core.TypedLocalObjectReference
154153
}{
155154
"enabled with empty ds": {
156-
spec: core.PersistentVolumeClaimSpec{},
157-
gateEnabled: true,
158-
want: nil,
155+
spec: core.PersistentVolumeClaimSpec{},
156+
want: nil,
159157
},
160158
"enabled with invalid spec": {
161-
spec: invalidSpec,
162-
gateEnabled: true,
163-
want: nil,
159+
spec: invalidSpec,
160+
want: nil,
164161
},
165162
"enabled with valid spec": {
166-
spec: validSpec,
167-
gateEnabled: true,
168-
want: validSpec.DataSource,
169-
},
170-
"disabled with invalid spec": {
171-
spec: invalidSpec,
172-
gateEnabled: false,
173-
want: nil,
174-
},
175-
"disabled with valid spec": {
176-
spec: validSpec,
177-
gateEnabled: false,
178-
want: nil,
179-
},
180-
"diabled with empty ds": {
181-
spec: core.PersistentVolumeClaimSpec{},
182-
gateEnabled: false,
183-
want: nil,
163+
spec: validSpec,
164+
want: validSpec.DataSource,
184165
},
185166
"enabled with valid spec but nil APIGroup": {
186-
spec: validSpecNilAPIGroup,
187-
gateEnabled: true,
188-
want: validSpecNilAPIGroup.DataSource,
189-
},
190-
"disabled with valid spec but nil APIGroup": {
191-
spec: validSpecNilAPIGroup,
192-
gateEnabled: false,
193-
want: nil,
167+
spec: validSpecNilAPIGroup,
168+
want: validSpecNilAPIGroup.DataSource,
194169
},
195170
}
196171

197172
for testName, test := range tests {
198173
t.Run(testName, func(t *testing.T) {
199-
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.VolumePVCDataSource, test.gateEnabled)()
200174
DropDisabledFields(&test.spec, nil)
201175
if test.spec.DataSource != test.want {
202-
t.Errorf("expected drop datasource condition was not met, test: %s, gateEnabled: %v, spec: %v, expected: %v", testName, test.gateEnabled, test.spec, test.want)
176+
t.Errorf("expected drop datasource condition was not met, test: %s, spec: %v, expected: %v", testName, test.spec, test.want)
203177
}
204178

205179
})

pkg/apis/core/types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,10 @@ type PersistentVolumeClaimSpec struct {
418418
// +optional
419419
VolumeMode *PersistentVolumeMode
420420
// This field can be used to specify either:
421-
// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
421+
// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta)
422422
// * An existing PVC (PersistentVolumeClaim)
423-
// In order to use either of these DataSource types, the appropriate feature gate
424-
// must be enabled (VolumeSnapshotDataSource, VolumePVCDataSource)
423+
// In order to use VolumeSnapshot object types, the appropriate feature gate
424+
// must be enabled (VolumeSnapshotDataSource)
425425
// If the provisioner can support the specified data source, it will create
426426
// a new volume based on the contents of the specified PVC or Snapshot.
427427
// If the provisioner does not support the specified data source, the volume will

pkg/features/kube_features.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ const (
477477
// owner: @j-griffith
478478
// alpha: v1.15
479479
// beta: v1.16
480+
// GA: v1.18
480481
//
481482
// Enable support for specifying an existing PVC as a DataSource
482483
VolumePVCDataSource featuregate.Feature = "VolumePVCDataSource"
@@ -637,7 +638,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
637638
ServiceLoadBalancerFinalizer: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
638639
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
639640
NonPreemptingPriority: {Default: false, PreRelease: featuregate.Alpha},
640-
VolumePVCDataSource: {Default: true, PreRelease: featuregate.Beta},
641+
VolumePVCDataSource: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
641642
PodOverhead: {Default: true, PreRelease: featuregate.Beta},
642643
IPv6DualStack: {Default: false, PreRelease: featuregate.Alpha},
643644
EndpointSlice: {Default: true, PreRelease: featuregate.Beta},

staging/src/k8s.io/api/core/v1/generated.proto

+8-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/core/v1/types.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,14 @@ type PersistentVolumeClaimSpec struct {
461461
// Value of Filesystem is implied when not included in claim spec.
462462
// +optional
463463
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"`
464-
// This field requires the VolumeSnapshotDataSource alpha feature gate to be
465-
// enabled and currently VolumeSnapshot is the only supported data source.
466-
// If the provisioner can support VolumeSnapshot data source, it will create
467-
// a new volume and data will be restored to the volume at the same time.
468-
// If the provisioner does not support VolumeSnapshot data source, volume will
464+
// This field can be used to specify either:
465+
// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta)
466+
// * An existing PVC (PersistentVolumeClaim)
467+
// In order to use VolumeSnapshot object types, the appropriate feature gate
468+
// must be enabled (VolumeSnapshotDataSource)
469+
// If the provisioner can support the specified data source, it will create
470+
// a new volume based on the contents of the specified PVC or Snapshot.
471+
// If the provisioner does not support the specified data source, the volume will
469472
// not be created and the failure will be reported as an event.
470473
// In the future, we plan to support more data source types and the behavior
471474
// of the provisioner may change.

staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)