CSIStorageCapacity: use v1 as storage version

This can be done because downgrades are only supported down to 1.24 and that
release supports v1.
This commit is contained in:
Patrick Ohly
2022-04-08 17:24:26 +02:00
parent 4569e646ef
commit 2e8fa3ee6b
3 changed files with 15 additions and 8 deletions

View File

@@ -33,7 +33,6 @@ import (
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/networking"
"k8s.io/kubernetes/pkg/apis/policy"
apisstorage "k8s.io/kubernetes/pkg/apis/storage"
)
// SpecialDefaultResourcePrefixes are prefixes compiled into Kubernetes.
@@ -61,9 +60,17 @@ func DefaultWatchCacheSizes() map[schema.GroupResource]int {
func NewStorageFactoryConfig() *StorageFactoryConfig {
resources := []schema.GroupVersionResource{
// TODO (https://github.com/kubernetes/kubernetes/issues/108451): remove the override in
// 1.25.
apisstorage.Resource("csistoragecapacities").WithVersion("v1beta1"),
// If a resource has to be stored in a version that is not the
// latest, then it can be listed here. Usually this is the case
// when a new version for a resource gets introduced and a
// downgrade to an older apiserver that doesn't know the new
// version still needs to be supported for one release.
//
// Example from Kubernetes 1.24 where csistoragecapacities had just
// graduated to GA:
//
// TODO (https://github.com/kubernetes/kubernetes/issues/108451): remove the override in 1.25.
// apisstorage.Resource("csistoragecapacities").WithVersion("v1beta1"),
}
return &StorageFactoryConfig{