Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove external driver duplicated misleading SupportedSizeRange #96875

Merged
merged 1 commit into from Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/storage/external/BUILD
Expand Up @@ -15,6 +15,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/framework/config:go_default_library",
"//test/e2e/framework/log:go_default_library",
"//test/e2e/framework/pod:go_default_library",
"//test/e2e/framework/skipper:go_default_library",
"//test/e2e/framework/volume:go_default_library",
Expand Down
12 changes: 5 additions & 7 deletions test/e2e/storage/external/external.go
Expand Up @@ -32,6 +32,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/kubernetes/test/e2e/framework"
e2econfig "k8s.io/kubernetes/test/e2e/framework/config"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
e2evolume "k8s.io/kubernetes/test/e2e/framework/volume"
Expand Down Expand Up @@ -120,10 +121,6 @@ type driverDefinition struct {
ReadOnly bool
}

// SupportedSizeRange defines the desired size of dynamically
// provisioned volumes.
SupportedSizeRange e2evolume.SizeRange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that setting this field never worked right? So it should be safe to remove without breaking anyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is never working. Nobody is consuming this field.


// ClientNodeName selects a specific node for scheduling test pods.
// Can be left empty. Most drivers should not need this and instead
// use topology to ensure that pods land on the right node(s).
Expand Down Expand Up @@ -158,6 +155,7 @@ func (t testDriverParameter) Set(filename string) error {
// to define the tests.
func AddDriverDefinition(filename string) error {
driver, err := loadDriverDefinition(filename)
e2elog.Logf("Driver loaded from path [%s]: %+v", filename, driver)
if err != nil {
return err
}
Expand Down Expand Up @@ -187,9 +185,9 @@ func loadDriverDefinition(filename string) (*driverDefinition, error) {
SupportedFsType: sets.NewString(
"", // Default fsType
),
},
SupportedSizeRange: e2evolume.SizeRange{
Min: "5Gi",
SupportedSizeRange: e2evolume.SizeRange{
Min: "5Gi",
},
},
}
// TODO: strict checking of the file content once https://github.com/kubernetes/kubernetes/pull/71589
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/storage/external/external_test.go
Expand Up @@ -33,9 +33,9 @@ func TestDriverParameter(t *testing.T) {
SupportedFsType: sets.NewString(
"", // Default fsType
),
},
SupportedSizeRange: e2evolume.SizeRange{
Min: "5Gi",
SupportedSizeRange: e2evolume.SizeRange{
Min: "10Gi",
},
},
}
testcases := []struct {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/storage/external/testdata/driver.json
@@ -1 +1 @@
{"DriverInfo": {"Name": "foo.example.com"}, "ShortName": "foo"}
{"DriverInfo": {"Name": "foo.example.com", "SupportedSizeRange": { "Min": "10Gi"}}, "ShortName": "foo"}
2 changes: 2 additions & 0 deletions test/e2e/storage/external/testdata/driver.yaml
@@ -1,3 +1,5 @@
DriverInfo:
Name: foo.example.com
SupportedSizeRange:
Min: 10Gi
ShortName: foo
3 changes: 2 additions & 1 deletion test/e2e/storage/testsuites/base.go
Expand Up @@ -236,7 +236,8 @@ func CreateVolumeResource(driver TestDriver, config *PerTestConfig, pattern test
driverVolumeSizeRange := dDriver.GetDriverInfo().SupportedSizeRange
claimSize, err := getSizeRangesIntersection(testVolumeSizeRange, driverVolumeSizeRange)
framework.ExpectNoError(err, "determine intersection of test size range %+v and driver size range %+v", testVolumeSizeRange, driverVolumeSizeRange)
framework.Logf("Using claimSize:%s, test suite supported size:%v, driver(%s) supported size:%v ", claimSize, testVolumeSizeRange, dDriver.GetDriverInfo().Name, testVolumeSizeRange)
framework.Logf("Using claimSize:%s, test suite supported size:%v, driver(%s) supported size:%v ",
claimSize, testVolumeSizeRange, dDriver.GetDriverInfo().Name, driverVolumeSizeRange)
r.Sc = dDriver.GetDynamicProvisionStorageClass(r.Config, pattern.FsType)

if pattern.BindingMode != "" {
Expand Down