Skip to content

Commit 61847ea

Browse files
authored
Merge pull request kubernetes#84814 from huffmanca/ga_csi_driver
Moving CSI Driver to GA.
2 parents 0669581 + d089053 commit 61847ea

File tree

70 files changed

+3027
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3027
-467
lines changed

api/api-rules/violation_exceptions.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ API rule violation: list_type_missing,k8s.io/api/settings/v1alpha1,PodPresetSpec
341341
API rule violation: list_type_missing,k8s.io/api/settings/v1alpha1,PodPresetSpec,EnvFrom
342342
API rule violation: list_type_missing,k8s.io/api/settings/v1alpha1,PodPresetSpec,VolumeMounts
343343
API rule violation: list_type_missing,k8s.io/api/settings/v1alpha1,PodPresetSpec,Volumes
344+
API rule violation: list_type_missing,k8s.io/api/storage/v1,CSIDriverList,Items
344345
API rule violation: list_type_missing,k8s.io/api/storage/v1,CSINodeDriver,TopologyKeys
345346
API rule violation: list_type_missing,k8s.io/api/storage/v1,CSINodeList,Items
346347
API rule violation: list_type_missing,k8s.io/api/storage/v1,CSINodeSpec,Drivers

api/openapi-spec/swagger.json

Lines changed: 990 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/kube-controller-manager/app/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ go_library(
127127
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
128128
"//staging/src/k8s.io/client-go/informers:go_default_library",
129129
"//staging/src/k8s.io/client-go/informers/storage/v1:go_default_library",
130-
"//staging/src/k8s.io/client-go/informers/storage/v1beta1:go_default_library",
131130
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
132131
"//staging/src/k8s.io/client-go/metadata:go_default_library",
133132
"//staging/src/k8s.io/client-go/metadata/metadatainformer:go_default_library",

cmd/kube-controller-manager/app/core.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ import (
3030

3131
"k8s.io/klog"
3232

33-
"k8s.io/api/core/v1"
33+
v1 "k8s.io/api/core/v1"
3434
"k8s.io/apimachinery/pkg/runtime/schema"
3535
utilfeature "k8s.io/apiserver/pkg/util/feature"
3636
cacheddiscovery "k8s.io/client-go/discovery/cached/memory"
3737
storagev1informer "k8s.io/client-go/informers/storage/v1"
38-
storagev1beta1informer "k8s.io/client-go/informers/storage/v1beta1"
3938
clientset "k8s.io/client-go/kubernetes"
4039
"k8s.io/client-go/metadata"
4140
restclient "k8s.io/client-go/rest"
@@ -313,15 +312,12 @@ func startAttachDetachController(ctx ControllerContext) (http.Handler, bool, err
313312
}
314313

315314
var (
316-
csiNodeInformer storagev1informer.CSINodeInformer
317-
csiDriverInformer storagev1beta1informer.CSIDriverInformer
315+
csiNodeInformer storagev1informer.CSINodeInformer
318316
)
319317
if utilfeature.DefaultFeatureGate.Enabled(features.CSINodeInfo) {
320318
csiNodeInformer = ctx.InformerFactory.Storage().V1().CSINodes()
321319
}
322-
if utilfeature.DefaultFeatureGate.Enabled(features.CSIDriverRegistry) {
323-
csiDriverInformer = ctx.InformerFactory.Storage().V1beta1().CSIDrivers()
324-
}
320+
csiDriverInformer := ctx.InformerFactory.Storage().V1().CSIDrivers()
325321

326322
plugins, err := ProbeAttachableVolumePlugins()
327323
if err != nil {

pkg/api/testing/defaulting_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ func TestDefaulting(t *testing.T) {
163163
{Group: "storage.k8s.io", Version: "v1", Kind: "StorageClassList"}: {},
164164
{Group: "storage.k8s.io", Version: "v1", Kind: "VolumeAttachment"}: {},
165165
{Group: "storage.k8s.io", Version: "v1", Kind: "VolumeAttachmentList"}: {},
166+
{Group: "storage.k8s.io", Version: "v1", Kind: "CSIDriver"}: {},
167+
{Group: "storage.k8s.io", Version: "v1", Kind: "CSIDriverList"}: {},
166168
{Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachment"}: {},
167169
{Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachmentList"}: {},
168170
{Group: "authentication.k8s.io", Version: "v1", Kind: "TokenRequest"}: {},

pkg/apis/storage/v1/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ go_library(
2020
"//pkg/apis/core:go_default_library",
2121
"//pkg/apis/core/v1:go_default_library",
2222
"//pkg/apis/storage:go_default_library",
23+
"//pkg/features:go_default_library",
2324
"//staging/src/k8s.io/api/core/v1:go_default_library",
2425
"//staging/src/k8s.io/api/storage/v1:go_default_library",
2526
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
2627
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
2728
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
29+
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
2830
],
2931
)
3032

pkg/apis/storage/v1/defaults.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ limitations under the License.
1717
package v1
1818

1919
import (
20-
"k8s.io/api/core/v1"
20+
v1 "k8s.io/api/core/v1"
2121
storagev1 "k8s.io/api/storage/v1"
2222
"k8s.io/apimachinery/pkg/runtime"
23+
utilfeature "k8s.io/apiserver/pkg/util/feature"
24+
"k8s.io/kubernetes/pkg/features"
2325
)
2426

2527
func addDefaultingFuncs(scheme *runtime.Scheme) error {
@@ -37,3 +39,17 @@ func SetDefaults_StorageClass(obj *storagev1.StorageClass) {
3739
*obj.VolumeBindingMode = storagev1.VolumeBindingImmediate
3840
}
3941
}
42+
43+
func SetDefaults_CSIDriver(obj *storagev1.CSIDriver) {
44+
if obj.Spec.AttachRequired == nil {
45+
obj.Spec.AttachRequired = new(bool)
46+
*(obj.Spec.AttachRequired) = true
47+
}
48+
if obj.Spec.PodInfoOnMount == nil {
49+
obj.Spec.PodInfoOnMount = new(bool)
50+
*(obj.Spec.PodInfoOnMount) = false
51+
}
52+
if len(obj.Spec.VolumeLifecycleModes) == 0 && utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) {
53+
obj.Spec.VolumeLifecycleModes = append(obj.Spec.VolumeLifecycleModes, storagev1.VolumeLifecyclePersistent)
54+
}
55+
}

pkg/apis/storage/v1/zz_generated.conversion.go

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/storage/v1/zz_generated.defaults.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controller/volume/attachdetach/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ go_library(
3434
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
3535
"//staging/src/k8s.io/client-go/informers/core/v1:go_default_library",
3636
"//staging/src/k8s.io/client-go/informers/storage/v1:go_default_library",
37-
"//staging/src/k8s.io/client-go/informers/storage/v1beta1:go_default_library",
3837
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
3938
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
4039
"//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
4140
"//staging/src/k8s.io/client-go/listers/core/v1:go_default_library",
4241
"//staging/src/k8s.io/client-go/listers/storage/v1:go_default_library",
43-
"//staging/src/k8s.io/client-go/listers/storage/v1beta1:go_default_library",
4442
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
4543
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
4644
"//staging/src/k8s.io/client-go/util/workqueue:go_default_library",

0 commit comments

Comments
 (0)