Skip to content

Commit

Permalink
upsert plan state bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yanjiaxin534 committed Jan 21, 2025
1 parent c09bb82 commit 9196770
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions api/pkg/apis/v1alpha1/managers/solution/solution-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,28 @@ func (s *SolutionManager) HandleDeploymentPlan(ctx context.Context, event v1alph
func (s *SolutionManager) upsertPlanState(ctx context.Context, planId string, planState *PlanState) error {
upsertRequest := states.UpsertRequest{
Value: states.StateEntry{
ID: planId,
Body: planState},
}
ID: planId,
Body: map[string]interface{}{
"ID": planState.ID,
"PlanId": planState.PlanId,
"Phase": planState.Phase,
"StartTime": planState.StartTime,
"ExpireTime": planState.ExpireTime,
"TotalSteps": planState.TotalSteps,
"CompletedSteps": planState.CompletedSteps,
"Summary": planState.Summary,
"MergedState": planState.MergedState,
"Deployment": planState.Deployment,
"CurrentState": planState.CurrentState,
"PreviousDesiredState": planState.PreviousDesiredState,
"Status": planState.Status,
"TargetResult": planState.TargetResult,
"Namespace": planState.Namespace,
"Remove": planState.Remove,
"StepStates": planState.StepStates,
"Steps": planState.Steps,
},
}}
_, err := s.StateProvider.Upsert(ctx, upsertRequest)
return err
}
Expand Down

0 comments on commit 9196770

Please sign in to comment.