Skip to content

Commit

Permalink
refactor(main): skip success exec (#4162) (#4170)
Browse files Browse the repository at this point in the history
Co-authored-by: cuisongliu <cuisongliu@qq.com>
  • Loading branch information
sealos-ci-robot and cuisongliu authored Oct 26, 2023
1 parent e1a099e commit e8fd12c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/apply/applydrivers/apply_drivers_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (c *Applier) updateStatus(clusterErr error, appErr error) {
cmdCondition = v2.NewFailedCommandCondition(appErr.Error())
}
} else if len(c.RunNewImages) > 0 {
cmdCondition = v2.NewSuccessCommandCondition()
return
}
cmdCondition.Images = c.RunNewImages
c.ClusterDesired.Status.CommandConditions = v2.UpdateCommandCondition(c.ClusterDesired.Status.CommandConditions, cmdCondition)
Expand Down
10 changes: 0 additions & 10 deletions pkg/types/v1beta1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ type CommandCondition struct {
Message string `json:"message,omitempty"`
}

func NewSuccessCommandCondition() CommandCondition {
return CommandCondition{
Type: CommandConditionTypeSuccess,
Status: v1.ConditionTrue,
LastHeartbeatTime: metav1.Now(),
Reason: "Apply Command",
Message: "Applied to cluster successfully",
}
}

func NewFailedCommandCondition(message string) CommandCondition {
return CommandCondition{
Type: CommandConditionTypeError,
Expand Down

0 comments on commit e8fd12c

Please sign in to comment.