diff --git a/controllers/hibernator_controller_test.go b/controllers/hibernator_controller_test.go index 6c6f756..1b6a4b6 100644 --- a/controllers/hibernator_controller_test.go +++ b/controllers/hibernator_controller_test.go @@ -108,6 +108,7 @@ func TestHibernatorReconciler_hibernate(t *testing.T) { historyUtil History resourceAction ResourceAction resourceSelector ResourceSelector + log logr.Logger } type args struct { hibernator v1alpha1.Hibernator @@ -124,6 +125,7 @@ func TestHibernatorReconciler_hibernate(t *testing.T) { fields: fields{ kubectl: pkg.NewKubectl(), historyUtil: &HistoryImpl{}, + log: controllerruntime.Log.WithName("controllers").WithName("Hibernator"), }, args: args{ hibernator: hibernator, @@ -141,7 +143,7 @@ func TestHibernatorReconciler_hibernate(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - r := NewHibernatorActionImpl(tt.fields.kubectl, tt.fields.historyUtil, tt.fields.resourceAction, tt.fields.resourceSelector) + r := NewHibernatorActionImpl(tt.fields.kubectl, tt.fields.historyUtil, tt.fields.resourceAction, tt.fields.resourceSelector, tt.fields.log) got, _ := r.hibernate(&tt.args.hibernator, tt.args.timeGap) if !reflect.DeepEqual(got, tt.want) { t.Errorf("hibernate() got = %v, want %v", got, tt.want)