diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index aeb57dc6ed..1e4de863c2 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -118,7 +118,7 @@ func (dp *deploymentProcessor) Render(ctx context.Context, resourceID resources. c := app.Properties.Status.Compute // Override environment-scope namespace with application-scope kubernetes namespace. - if c.Kind == rpv1.KubernetesComputeKind { + if c != nil && c.Kind == rpv1.KubernetesComputeKind { envOptions.Namespace = c.KubernetesCompute.Namespace } diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index 533724b41f..e7267f8b7c 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -81,6 +81,11 @@ func (t *TestResource) GetRecipe() *portableresources.ResourceRecipe { return &t.Properties.Recipe } +// SetRecipe allows updating the recipe in the resource. +func (t *TestResource) SetRecipe(r *portableresources.ResourceRecipe) { + t.Properties.Recipe = *r +} + type TestResourceProperties struct { rpv1.BasicResourceProperties IsProcessed bool `json:"isProcessed"` @@ -207,6 +212,7 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { nil, fmt.Errorf("could not find recipe %q in environment %q", "test-recipe", TestEnvironmentID), }, + { "runtime-configuration-err", func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) {