Skip to content

Commit

Permalink
Address review feedback #3
Browse files Browse the repository at this point in the history
Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com>
  • Loading branch information
rashmigottipati committed Jun 7, 2021
1 parent 60ab6fd commit 5eb033d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/finalizer/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ import (

type finalizers map[string]Finalizer

// Result struct holds Updated and StatusUpdated fields
// Result struct holds information about what parts of an object were updated by finalizer(s).
type Result struct {
Updated bool
// Updated will be true if at least one of the object's non-status field
// was updated by some registered finalizer.
Updated bool
// StatusUpdated will be true if at least one of the object's status' fields
// was updated by some registered finalizer.
StatusUpdated bool
}

Expand Down Expand Up @@ -66,6 +70,8 @@ func (f finalizers) Finalize(ctx context.Context, obj client.Object) (Result, er
// object's metadata, so we know it will need an update.
res.Updated = true
controllerutil.RemoveFinalizer(obj, key)
// The finalizer may have updated the status too.
res.StatusUpdated = res.StatusUpdated || finalizerRes.StatusUpdated
}
}
}
Expand Down

0 comments on commit 5eb033d

Please sign in to comment.