Skip to content

Commit 5eb033d

Browse files
Address review feedback #3
Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent 60ab6fd commit 5eb033d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/finalizer/finalizer.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ import (
2424

2525
type finalizers map[string]Finalizer
2626

27-
// Result struct holds Updated and StatusUpdated fields
27+
// Result struct holds information about what parts of an object were updated by finalizer(s).
2828
type Result struct {
29-
Updated bool
29+
// Updated will be true if at least one of the object's non-status field
30+
// was updated by some registered finalizer.
31+
Updated bool
32+
// StatusUpdated will be true if at least one of the object's status' fields
33+
// was updated by some registered finalizer.
3034
StatusUpdated bool
3135
}
3236

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

0 commit comments

Comments
 (0)