mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
refactor: clean code
This commit is contained in:
parent
92c93822b9
commit
edaf08361f
@ -41,11 +41,11 @@ func (n *applyNode) Process(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检测是否可以跳过本次执行
|
// 检测是否可以跳过本次执行
|
||||||
if skippable, skipReason := n.checkCanSkip(ctx, lastOutput); skippable {
|
if skippable, reason := n.checkCanSkip(ctx, lastOutput); skippable {
|
||||||
n.logger.Info(fmt.Sprintf("skip this application, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("skip this application, because %s", reason))
|
||||||
return nil
|
return nil
|
||||||
} else if skipReason != "" {
|
} else if reason != "" {
|
||||||
n.logger.Info(fmt.Sprintf("re-apply, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("re-apply, because %s", reason))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化申请器
|
// 初始化申请器
|
||||||
|
@ -54,11 +54,11 @@ func (n *deployNode) Process(ctx context.Context) error {
|
|||||||
|
|
||||||
// 检测是否可以跳过本次执行
|
// 检测是否可以跳过本次执行
|
||||||
if lastOutput != nil && certificate.CreatedAt.Before(lastOutput.UpdatedAt) {
|
if lastOutput != nil && certificate.CreatedAt.Before(lastOutput.UpdatedAt) {
|
||||||
if skippable, skipReason := n.checkCanSkip(ctx, lastOutput); skippable {
|
if skippable, reason := n.checkCanSkip(ctx, lastOutput); skippable {
|
||||||
n.logger.Info(fmt.Sprintf("skip this deployment, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("skip this deployment, because %s", reason))
|
||||||
return nil
|
return nil
|
||||||
} else if skipReason != "" {
|
} else if reason != "" {
|
||||||
n.logger.Info(fmt.Sprintf("re-deploy, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("re-deploy, because %s", reason))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ func (n *uploadNode) Process(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检测是否可以跳过本次执行
|
// 检测是否可以跳过本次执行
|
||||||
if skippable, skipReason := n.checkCanSkip(ctx, lastOutput); skippable {
|
if skippable, reason := n.checkCanSkip(ctx, lastOutput); skippable {
|
||||||
n.logger.Info(fmt.Sprintf("skip this upload, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("skip this upload, because %s", reason))
|
||||||
return nil
|
return nil
|
||||||
} else if skipReason != "" {
|
} else if reason != "" {
|
||||||
n.logger.Info(fmt.Sprintf("re-upload, because %s", skipReason))
|
n.logger.Info(fmt.Sprintf("re-upload, because %s", reason))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成证书实体
|
// 生成证书实体
|
||||||
|
Loading…
x
Reference in New Issue
Block a user