Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Feb 6, 2024
1 parent 76f5785 commit 7058b02
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 7 additions & 4 deletions pkg/corerp/backend/controller/createorupdateresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
rpv1 "github.com/radius-project/radius/pkg/rp/v1"
"github.com/radius-project/radius/pkg/ucp/resources"
"github.com/radius-project/radius/pkg/ucp/store"
"github.com/radius-project/radius/pkg/ucp/ucplog"
)

var _ ctrl.Controller = (*CreateOrUpdateResource)(nil)
Expand Down Expand Up @@ -101,9 +102,11 @@ func (c *CreateOrUpdateResource) Run(ctx context.Context, request *ctrl.Request)
return ctrl.Result{}, err
}

deploymentOutput, err := c.DeploymentProcessor().Deploy(ctx, id, rendererOutput)
if err != nil {
return ctrl.Result{}, err
deploymentOutput, deployErr := c.DeploymentProcessor().Deploy(ctx, id, rendererOutput)
if deployErr != nil {
logger := ucplog.FromContextOrDiscard(ctx)
logger.Info("failed to deploy resource", "resourceID", id.String())
//return ctrl.Result{}, err
}

deploymentDataModel, ok := dataModel.(rpv1.DeploymentDataModel)
Expand Down Expand Up @@ -136,5 +139,5 @@ func (c *CreateOrUpdateResource) Run(ctx context.Context, request *ctrl.Request)
return ctrl.Result{}, err
}

return ctrl.Result{}, err
return ctrl.Result{}, deployErr
}
13 changes: 12 additions & 1 deletion pkg/corerp/backend/deployment/deploymentprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,18 @@ func (dp *deploymentProcessor) Deploy(ctx context.Context, id resources.ID, rend

err := dp.deployOutputResource(ctx, id, rendererOutput, computedValues, &handlers.PutOptions{Resource: &outputResource, DependencyProperties: deployedOutputResourceProperties})
if err != nil {
return rpv1.DeploymentOutput{}, err
outputResource := rpv1.OutputResource{
LocalID: outputResource.LocalID,
ID: outputResource.ID,
}
deployedOutputResources = append(deployedOutputResources, outputResource)

return rpv1.DeploymentOutput{
DeployedOutputResources: deployedOutputResources,
ComputedValues: computedValues,
SecretValues: rendererOutput.SecretValues,
}, err
//return rpv1.DeploymentOutput{}, err
}

if outputResource.ID.IsEmpty() {
Expand Down

0 comments on commit 7058b02

Please sign in to comment.