Skip to content

Commit

Permalink
Merge branch 'release/v0.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Nov 6, 2020
2 parents 538f2a5 + b250ad5 commit aeee379
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion linux/script-resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ func (h handlerScriptResource) getChangedKeys(rd *schema.ResourceData) (ks []str
}

func (h handlerScriptResource) shouldIgnoreUpdate(rd *schema.ResourceData) bool {
if _, ok := rd.GetOk(attrScriptLifecycleCommands + ".0." + attrScriptLifecycleCommandUpdate); !ok {
return true
}
for _, k := range h.getChangedKeys(rd) {
if k != attrScriptLifecycleCommands+".0."+attrScriptLifecycleCommandCreate &&
k != attrScriptLifecycleCommands+".0."+attrScriptLifecycleCommandDelete {
Expand Down Expand Up @@ -267,7 +270,7 @@ func (h handlerScriptResource) CustomizeDiff(c context.Context, rd *schema.Resou

if f, _ := rd.GetChange(attrScriptReadFailed); cast.ToBool(f) &&
!rd.HasChange(attrScriptLifecycleCommands+".0."+attrScriptLifecycleCommandRead) {
_ = rd.ForceNew(attrScriptReadFailed)
_ = rd.ForceNew(attrScriptReadFailed) // read failed and read script not updated
}
if _, ok := rd.GetOk(attrScriptLifecycleCommands + ".0." + attrScriptLifecycleCommandUpdate); ok {
return
Expand Down

0 comments on commit aeee379

Please sign in to comment.