Skip to content

Commit 08f12af

Browse files
committed
test(controllers): migrate runtime controller tests
Signed-off-by: Harsh <harshmastic@gmail.com>
1 parent a69c888 commit 08f12af

4 files changed

Lines changed: 722 additions & 3 deletions

File tree

pkg/controllers/runtime_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ func (r *RuntimeReconciler) AddOwnerAndRequeue(ctx cruntime.ReconcileRequestCont
361361

362362
// GetRuntimeObjectMeta gets runtime object meta
363363
func (r *RuntimeReconciler) GetRuntimeObjectMeta(ctx cruntime.ReconcileRequestContext) (objectMeta metav1.Object, err error) {
364+
if ctx.Runtime == nil || reflect.ValueOf(ctx.Runtime).IsNil() {
365+
err = fmt.Errorf("runtime is nil")
366+
return
367+
}
368+
364369
objectMetaAccessor, isOM := ctx.Runtime.(metav1.ObjectMetaAccessor)
365370
if !isOM {
366371
// return utils.RequeueIfError(fmt.Errorf("object is not ObjectMetaAccessor"))

0 commit comments

Comments
 (0)