Add check for PVC status in E2E tests (#1707)

* Add check for PVC status in E2E tests

* Update test/e2e/service_test.go

Co-authored-by: Gunjan Vyas <vyasgun20@gmail.com>

Co-authored-by: Gunjan Vyas <vyasgun20@gmail.com>
This commit is contained in:
David Simansky 2022-07-21 18:21:19 +02:00 committed by GitHub
parent 452863fb54
commit 2f1eefe6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -240,11 +240,17 @@ func serviceCreateWithMount(r *test.KnRunResultCollector) {
assert.NilError(r.T(), err) assert.NilError(r.T(), err)
r.AssertNoError(out) r.AssertNoError(out)
_, err = kubectl.Run("wait", "--for='jsonpath={..status.phase}'=Bound", "pvc/test-pvc", "--timeout=30s")
if err == nil {
r.T().Log("update service with a new pvc mount") r.T().Log("update service with a new pvc mount")
out = r.KnTest().Kn().Run("service", "update", "test-svc", "--mount", "/mydir5=pvc:test-pvc") out = r.KnTest().Kn().Run("service", "update", "test-svc", "--mount", "/mydir5=pvc:test-pvc")
r.AssertNoError(out) r.AssertNoError(out)
serviceDescribeMount(r, "test-svc", "/mydir", "key") serviceDescribeMount(r, "test-svc", "/mydir", "key")
} else {
r.T().Log("PVC test skip due to unsatisfied PVC")
}
} }
func getVolumeMountWithHostPath(svc *servingv1.Service, hostPath string) *v1.VolumeMount { func getVolumeMountWithHostPath(svc *servingv1.Service, hostPath string) *v1.VolumeMount {