Skip to content

Commit

Permalink
[K10-2154] Add tomb cancel onDelete ActionSet (#5348)
Browse files Browse the repository at this point in the history
* Add tomb cancel onDelete ActionSet

* Address review comments

* Address review comments

* Refactor variable

* Refactor based on commits

* Remove log msg
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed Apr 8, 2019
1 parent 4872990 commit e8ee60e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,18 @@ func (c *Controller) onUpdateBlueprint(oldBP, newBP *crv1alpha1.Blueprint) error
}

func (c *Controller) onDeleteActionSet(as *crv1alpha1.ActionSet) error {
log.Infof("Deleted ActionSet %s", as.GetName())
asName := as.GetName()
log.Infof("Deleted ActionSet %s", asName)
v, ok := c.actionSetTombMap.Load(asName)
if !ok {
return nil
}
t, castOk := v.(*tomb.Tomb)
if !castOk {
return nil
}
t.Kill(nil) // TODO: @Deepika Give reason for ActionSet kill
c.actionSetTombMap.Delete(asName)
return nil
}

Expand Down

0 comments on commit e8ee60e

Please sign in to comment.