Skip to content

Commit

Permalink
make pulumi refresh configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Feb 13, 2024
1 parent 16f3930 commit 1f6a6a8
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 5 deletions.
17 changes: 12 additions & 5 deletions cloud/common/deploy/provider/pulumi.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ func (s *PulumiProviderServer) Up(req *deploymentspb.DeploymentUpRequest, stream
return err
}

err = s.provider.Init(req.Attributes.AsMap())
attributesMap := req.Attributes.AsMap()

err = s.provider.Init(attributesMap)
if err != nil {
return err
}
Expand Down Expand Up @@ -201,10 +203,15 @@ func (s *PulumiProviderServer) Up(req *deploymentspb.DeploymentUpRequest, stream
return err
}

_, err = autoStack.Refresh(context.TODO())
if err != nil {
logger.Errorf(err.Error())
return err
refresh, ok := attributesMap["refresh"].(bool)

if ok && refresh {
logger.Info("refreshing pulumi stack")
_, err = autoStack.Refresh(context.TODO())
if err != nil {
logger.Errorf(err.Error())
return err
}
}

result, err := autoStack.Up(context.TODO(), optup.EventStreams(pulumiEventsChan))
Expand Down
Loading

0 comments on commit 1f6a6a8

Please sign in to comment.