@@ -43,28 +43,28 @@ func newPlan(config *PlanConfig) (*levantPlan, error) {
4343}
4444
4545// TriggerPlan initiates a Levant plan run.
46- func TriggerPlan (config * PlanConfig ) bool {
46+ func TriggerPlan (config * PlanConfig ) ( bool , bool ) {
4747
4848 lp , err := newPlan (config )
4949 if err != nil {
5050 log .Error ().Err (err ).Msg ("levant/plan: unable to setup Levant plan" )
51- return false
51+ return false , false
5252 }
5353
5454 changes , err := lp .plan ()
5555 if err != nil {
5656 log .Error ().Err (err ).Msg ("levant/plan: error when running plan" )
57- return false
57+ return false , changes
5858 }
5959
6060 if ! changes && lp .config .Plan .IgnoreNoChanges {
6161 log .Info ().Msg ("levant/plan: no changes found in job but ignore-changes flag set to true" )
6262 } else if ! changes && ! lp .config .Plan .IgnoreNoChanges {
6363 log .Info ().Msg ("levant/plan: no changes found in job" )
64- return false
64+ return false , changes
6565 }
6666
67- return true
67+ return true , changes
6868}
6969
7070// plan is the entry point into running the Levant plan function which logs all
@@ -89,14 +89,14 @@ func (lp *levantPlan) plan() (bool, error) {
8989 log .Info ().Msg ("levant/plan: job is a new addition to the cluster" )
9090 return true , nil
9191
92- // If there are no changes, then log an error so the user can see this and
93- // exit the deployment.
92+ // If there are no changes, then log an error so the user can see this and
93+ // exit the deployment.
9494 case diffTypeNone :
9595 log .Error ().Msg ("levant/plan: no changes detected for job" )
9696 return false , nil
9797
98- // If there are changes, run the planDiff function which is responsible for
99- // iterating through the plan and logging all the planned changes.
98+ // If there are changes, run the planDiff function which is responsible for
99+ // iterating through the plan and logging all the planned changes.
100100 case diffTypeEdited :
101101 planDiff (resp .Diff )
102102 }
0 commit comments