Added pending phase for volumes. added defaults for PV/PVC. refactored to better phase transitioning in control loops

This commit is contained in:
markturansky
2015-04-21 11:05:15 -04:00
parent 37d7f3f4f1
commit a04420e548
16 changed files with 318 additions and 178 deletions

View File

@@ -174,6 +174,26 @@ func TestSetDefaultSecret(t *testing.T) {
}
}
func TestSetDefaultPersistentVolume(t *testing.T) {
pv := &current.PersistentVolume{}
obj2 := roundTrip(t, runtime.Object(pv))
pv2 := obj2.(*current.PersistentVolume)
if pv2.Status.Phase != current.VolumePending {
t.Errorf("Expected volume phase %v, got %v", current.VolumePending, pv2.Status.Phase)
}
}
func TestSetDefaultPersistentVolumeClaim(t *testing.T) {
pvc := &current.PersistentVolumeClaim{}
obj2 := roundTrip(t, runtime.Object(pvc))
pvc2 := obj2.(*current.PersistentVolumeClaim)
if pvc2.Status.Phase != current.ClaimPending {
t.Errorf("Expected claim phase %v, got %v", current.ClaimPending, pvc2.Status.Phase)
}
}
func TestSetDefaulEndpointsProtocol(t *testing.T) {
in := &current.Endpoints{Subsets: []current.EndpointSubset{
{Ports: []current.EndpointPort{{}, {Protocol: "UDP"}, {}}},