e2e: test for node expand volume with secrets failed

Signed-off-by: zhucan <zhucan.k8s@gmail.com>
This commit is contained in:
zhucan 2023-03-14 19:49:55 +08:00 committed by Paco Xu
parent a5587de2e4
commit 80ff4b90a5
3 changed files with 5 additions and 6 deletions

View File

@ -836,8 +836,8 @@ func compareCSICalls(ctx context.Context, trackedCalls []string, expectedCallSeq
// if the secret is not nil, compare it
if expectedCall.expectedSecret != nil {
if !reflect.DeepEqual(expectedCall.expectedSecret, c.Request.Secret) {
return allCalls, i, fmt.Errorf("Unexpected secret: expected %v, got %v", expectedCall.expectedSecret, c.Request.Secret)
if !reflect.DeepEqual(expectedCall.expectedSecret, c.Request.Secrets) {
return allCalls, i, fmt.Errorf("Unexpected secret: expected %v, got %v", expectedCall.expectedSecret, c.Request.Secrets)
}
}

View File

@ -311,10 +311,9 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() {
framework.ExpectNoError(err, "while waiting for PVC to finish")
ginkgo.By("Waiting for all remaining expected CSI calls")
var allCalls []drivers.MockCSICall
err = wait.Poll(time.Second, csiResizeWaitPeriod, func() (done bool, err error) {
var index int
allCalls, index, err = compareCSICalls(ctx, trackedCalls, test.expectedCalls, m.driver.GetCalls)
_, index, err = compareCSICalls(ctx, trackedCalls, test.expectedCalls, m.driver.GetCalls)
if err != nil {
return true, err
}
@ -328,7 +327,7 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() {
}
return false, nil
})
framework.ExpectNoError(err, fmt.Sprintf("while waiting for all CSI calls: %s", allCalls))
framework.ExpectNoError(err, "while waiting for all CSI calls")
pvcConditions := pvc.Status.Conditions
framework.ExpectEqual(len(pvcConditions), 0, "pvc should not have conditions")

View File

@ -379,7 +379,7 @@ type MockCSICall struct {
Method string
Request struct {
VolumeContext map[string]string `json:"volume_context"`
Secret map[string]string `json:"secret"`
Secrets map[string]string `json:"secrets"`
}
FullError struct {
Code codes.Code `json:"code"`