mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Added pending phase for volumes. added defaults for PV/PVC. refactored to better phase transitioning in control loops
This commit is contained in:
@@ -174,6 +174,26 @@ func TestSetDefaultSecret(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetDefaultPersistentVolume(t *testing.T) {
|
||||
pv := ¤t.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 := ¤t.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 := ¤t.Endpoints{Subsets: []current.EndpointSubset{
|
||||
{Ports: []current.EndpointPort{{}, {Protocol: "UDP"}, {}}},
|
||||
|
||||
Reference in New Issue
Block a user