Skip to content

Commit

Permalink
Fix condition cash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail committed Apr 24, 2018
1 parent 11ae788 commit c905fe6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/manager/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,14 @@ func New(
// Sometimes condition resources might refer to other condition resources.
// When they are constructed they will check will the manager to ensure the
// resource they point to is valid, but not use the condition. Since we
// cannot guarantee an order of initialisation we simple create placeholder
// conditions during construction. However, we make sure we don't add the
// constructing condition itself in order to avoid recursive conditions.
// cannot guarantee an order of initialisation we create placeholder
// conditions during construction.
for k := range conf.Conditions {
t.conditions[k] = nil
}

// TODO: Prevent recursive conditions.
for k, newConf := range conf.Conditions {
for k2 := range conf.Conditions {
if k != k2 {
t.conditions[k2] = nil
}
}

newCond, err := condition.New(newConf, t, log, stats)
if err != nil {
return nil, fmt.Errorf(
Expand Down

0 comments on commit c905fe6

Please sign in to comment.