Skip to content

Commit

Permalink
refactor(main): skip success exec (#4162) (#4170) (#4175)
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 committed Oct 26, 2023
1 parent 311213a commit 579a016
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
Expand Up @@ -166,7 +166,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
Expand Up @@ -172,16 +172,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 579a016

Please sign in to comment.