Skip to content

Commit

Permalink
fixing unit test errors
Browse files Browse the repository at this point in the history
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
  • Loading branch information
lakshmimsft committed Feb 4, 2025
1 parent 0d8d09b commit c9480a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/corerp/backend/deployment/deploymentprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c9480a3

Please sign in to comment.