Ensure PVL controller is next pending initializer before labeling the PV

This commit is contained in:
Josh Horwitz
2017-12-04 22:58:11 -05:00
parent 2175199646
commit 1f840944a6
2 changed files with 18 additions and 12 deletions

View File

@@ -146,11 +146,16 @@ func TestAddLabelsToVolume(t *testing.T) {
initializers: &metav1.Initializers{Pending: []metav1.Initializer{{Name: initializerName}}},
shouldLabel: true,
},
"PV with other initializers": {
"PV with other initializers only": {
vol: pv,
initializers: &metav1.Initializers{Pending: []metav1.Initializer{{Name: "OtherInit"}}},
shouldLabel: false,
},
"PV with other initializers first": {
vol: pv,
initializers: &metav1.Initializers{Pending: []metav1.Initializer{{Name: "OtherInit"}, {Name: initializerName}}},
shouldLabel: false,
},
}
for d, tc := range testCases {