-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
test: fix azure disk e2e test failure #82324
test: fix azure disk e2e test failure #82324
Conversation
This PR helps a bit. I had to change also PV / in-line volume definition this way: --- a/vendor/k8s.io/kubernetes/test/e2e/storage/drivers/in_tree.go
+++ b/vendor/k8s.io/kubernetes/test/e2e/storage/drivers/in_tree.go
@@ -1397,10 +1397,12 @@ func (a *azureDriver) GetVolumeSource(readOnly bool, fsType string, volume tests
diskName := av.volumeName[(strings.LastIndex(av.volumeName, "/") + 1):]
+ kind := v1.AzureManagedDisk
volSource := v1.VolumeSource{
AzureDisk: &v1.AzureDiskVolumeSource{
DiskName: diskName,
DataDiskURI: av.volumeName,
+ Kind: &kind,
ReadOnly: &readOnly,
},
}
@@ -1416,10 +1418,12 @@ func (a *azureDriver) GetPersistentVolumeSource(readOnly bool, fsType string, vo
diskName := av.volumeName[(strings.LastIndex(av.volumeName, "/") + 1):]
+ kind := v1.AzureManagedDisk
pvSource := v1.PersistentVolumeSource{
AzureDisk: &v1.AzureDiskVolumeSource{
DiskName: diskName,
DataDiskURI: av.volumeName,
+ Kind: &kind,
ReadOnly: &readOnly,
},
} And I had to restrict any pod that runs with a such in-line volume to a zone where the volume was created (the test creates the volume in --- a/test/e2e/storage/drivers/in_tree.go
+++ b/test/e2e/storage/drivers/in_tree.go
func (a *azureDriver) CreateVolume(config *testsuites.PerTestConfig, volType testpatterns.TestVolType) testsuites.TestVolume {
ginkgo.By("creating a test azure disk volume")
+ if volType == testpatterns.InlineVolume {
+ // Volume will be created in framework.TestContext.CloudConfig.Zone zone,
+ // so pods should be also scheduled there.
+ config.ClientNodeSelector = map[string]string{
+ v1.LabelZoneFailureDomain: framework.TestContext.CloudConfig.Zone,
+ }
+ }
volumeName, err := framework.CreatePDWithRetry()
framework.ExpectNoError(err)
return &azureVolume{ With these changes, I am able to run a test with in-line and pre-provisioned Azure volume. |
great, shall I merge your code change? @jsafrane |
Yes, if it looks good for you |
Thanks a lot for the PR! |
/assign @pohly @andrewsykim |
/retest |
ping @pohly @andrewsykim thanks |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, jsafrane, pohly The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind failing-test
What this PR does / why we need it:
This PR fixed the azure disk e2e test failure, default type of azure disk has been changed to
managed
, so in the test, we also need to change the disk type tomanaged
, otherwise we hit following error:Which issue(s) this PR fixes:
Fixes #82272
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/assign @jsafrane
cc @ritazh
/priority important-soon
/sig cloud-provider
/area provider/azure
/kind test