mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Bi-directional bind between pv.Spec.ClaimRef and pvc.Spec.VolumeName
This commit is contained in:
@@ -88,7 +88,7 @@ func TestPersistentVolumeClaimBinder(t *testing.T) {
|
||||
for {
|
||||
event := <-watch.ResultChan()
|
||||
claim := event.Object.(*api.PersistentVolumeClaim)
|
||||
if claim.Status.VolumeRef != nil {
|
||||
if claim.Spec.VolumeName != "" {
|
||||
boundCount++
|
||||
}
|
||||
if boundCount == expectedBoundCount {
|
||||
@@ -102,10 +102,10 @@ func TestPersistentVolumeClaimBinder(t *testing.T) {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
if (claim.Name == "claim01" || claim.Name == "claim02") && claim.Status.VolumeRef == nil {
|
||||
if (claim.Name == "claim01" || claim.Name == "claim02") && claim.Spec.VolumeName == "" {
|
||||
t.Errorf("Expected claim to be bound: %+v", claim)
|
||||
}
|
||||
if claim.Name == "claim03" && claim.Status.VolumeRef != nil {
|
||||
if claim.Name == "claim03" && claim.Spec.VolumeName != "" {
|
||||
t.Errorf("Expected claim03 to be unbound: %v", claim)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user