From 68823929ca1f32a833200def26ab9a61e6d3299a Mon Sep 17 00:00:00 2001 From: ArkBriar Date: Wed, 22 Nov 2023 17:25:12 +0800 Subject: [PATCH] fix: fix nil reference in sts update controller (#553) Signed-off-by: arkbriar --- pkg/controller/risingwave_compute_sts_update_strategy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/controller/risingwave_compute_sts_update_strategy.go b/pkg/controller/risingwave_compute_sts_update_strategy.go index 1ff4bc61..ab49c623 100644 --- a/pkg/controller/risingwave_compute_sts_update_strategy.go +++ b/pkg/controller/risingwave_compute_sts_update_strategy.go @@ -137,6 +137,9 @@ func (s *RisingWaveComputeSTSUpdateStrategy) SetupWithManager(mgr ctrl.Manager) // Owned by RisingWave. ownerRef := metav1.GetControllerOfNoCopy(object) + if ownerRef == nil { + return nil + } if ownerRef.APIVersion != gvk.GroupVersion().String() || ownerRef.Kind != gvk.Kind { return nil }