CronJob: Check ControllerRef Name and UID in unit test.

This commit is contained in:
Anthony Yeh 2017-03-06 11:18:15 -08:00
parent 5cef455a0d
commit 4e1b07d9c2

View File

@ -302,6 +302,12 @@ func TestSyncOne_RunOrNot(t *testing.T) {
if got, want := controllerRef.Kind, "CronJob"; got != want {
t.Errorf("%s: controllerRef.Kind = %q, want %q", name, got, want)
}
if got, want := controllerRef.Name, sj.Name; got != want {
t.Errorf("%s: controllerRef.Name = %q, want %q", name, got, want)
}
if got, want := controllerRef.UID, sj.UID; got != want {
t.Errorf("%s: controllerRef.UID = %q, want %q", name, got, want)
}
if controllerRef.Controller == nil || *controllerRef.Controller != true {
t.Errorf("%s: controllerRef.Controller is not set to true", name)
}