From 90de97a55b74ec6074504a6072f77ae6e316f892 Mon Sep 17 00:00:00 2001 From: ytimocin Date: Fri, 9 Aug 2024 15:46:13 -0700 Subject: [PATCH] Adding a check to a cast to the Recipe object Signed-off-by: ytimocin --- cmd/applications-rp/radius-cloud.yaml | 2 +- cmd/controller/controller-self-hosted.yaml | 4 ++-- pkg/controller/reconciler/deployment_reconciler.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/applications-rp/radius-cloud.yaml b/cmd/applications-rp/radius-cloud.yaml index 5fc84223e3..acbcbe2401 100644 --- a/cmd/applications-rp/radius-cloud.yaml +++ b/cmd/applications-rp/radius-cloud.yaml @@ -45,7 +45,7 @@ featureFlags: - "PLACEHOLDER" ucp: kind: kubernetes - # Logging configuration + # Logging configuration logging: level: "info" json: false diff --git a/cmd/controller/controller-self-hosted.yaml b/cmd/controller/controller-self-hosted.yaml index 20e61f18ed..fa77435b77 100644 --- a/cmd/controller/controller-self-hosted.yaml +++ b/cmd/controller/controller-self-hosted.yaml @@ -13,7 +13,7 @@ server: host: "0.0.0.0" port: 8083 -# workerServer port specifies port set for Health Checks +# workerServer port specifies port set for Health Checks workerServer: port: 3000 ucp: @@ -22,4 +22,4 @@ ucp: endpoint: "http://localhost:9000/apis/api.ucp.dev/v1alpha3" logging: level: "info" - json: false \ No newline at end of file + json: false diff --git a/pkg/controller/reconciler/deployment_reconciler.go b/pkg/controller/reconciler/deployment_reconciler.go index e298654e32..9079570c3c 100644 --- a/pkg/controller/reconciler/deployment_reconciler.go +++ b/pkg/controller/reconciler/deployment_reconciler.go @@ -630,7 +630,10 @@ func (r *DeploymentReconciler) saveState(ctx context.Context, deployment *appsv1 } func (r *DeploymentReconciler) findDeploymentsForRecipe(ctx context.Context, obj client.Object) []reconcile.Request { - recipe := obj.(*radappiov1alpha3.Recipe) + recipe, ok := obj.(*radappiov1alpha3.Recipe) + if !ok { + return []reconcile.Request{} + } deployments := &appsv1.DeploymentList{} options := &client.ListOptions{