@@ -97,31 +97,25 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.P
9797 return approved , nil
9898}
9999
100- func deployCore (ctx context.Context , b * bundle.Bundle , plan * deployplan.Plan , engine engine.EngineType ) {
101- // Core mutators that CRUD resources and modify deployment state. These
102- // mutators need informed consent if they are potentially destructive.
100+ func deployCore (ctx context.Context , b * bundle.Bundle , plan * deployplan.Plan , targetEngine engine.EngineType ) {
103101 cmdio .LogString (ctx , "Deploying resources..." )
104102
105- if engine .IsDirect () {
103+ if targetEngine .IsDirect () {
106104 b .DeploymentBundle .Apply (ctx , b .WorkspaceClient (), plan , direct .MigrateMode (false ))
107105 } else {
108106 bundle .ApplyContext (ctx , b , terraform .Apply ())
109107 }
110108
111- // Even if deployment failed, there might be updates in state that we need
112- // to upload. For the filesystem-based state, this uploads the state file to
113- // the workspace. For the metadata service, this is a no-op since operation
114- // results are reported inline during deployment.
115- statemgmt .PushResourcesState (ctx , b , engine )
109+ statemgmt .PushResourcesState (ctx , b , targetEngine )
116110 if logdiag .HasError (ctx ) {
117111 return
118112 }
119113
120114 bundle .ApplySeqContext (ctx , b ,
121- statemgmt .Load (engine ),
115+ statemgmt .Load (targetEngine ),
122116 metadata .Compute (),
123117 metadata .Upload (),
124- statemgmt .UploadStateForYamlSync (engine ),
118+ statemgmt .UploadStateForYamlSync (targetEngine ),
125119 )
126120
127121 if ! logdiag .HasError (ctx ) {
0 commit comments