Skip to content

Commit 9d2c6e0

Browse files
committed
change WithoutField to WithoutFields
1 parent 3f69186 commit 9d2c6e0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/controller/status_updater.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@ func (b *StatusUpdaterBuilder[Obj, PhType, ConType]) WithNestedStruct(name strin
7474
return b
7575
}
7676

77-
// WithoutField removes the field from the status update.
78-
// This is an alias for WithFieldOverride(field, "").
79-
func (b *StatusUpdaterBuilder[Obj, PhType, ConType]) WithoutField(field StatusField) *StatusUpdaterBuilder[Obj, PhType, ConType] {
80-
return b.WithFieldOverride(field, "")
77+
// WithoutFields removes the specified fields from the status update.
78+
// It basically calls WithFieldOverride(field, "") for each field.
79+
// This can be used in combination with AllStatusFields() to disable all fields.
80+
func (b *StatusUpdaterBuilder[Obj, PhType, ConType]) WithoutFields(fields ...StatusField) *StatusUpdaterBuilder[Obj, PhType, ConType] {
81+
for _, field := range fields {
82+
b.WithFieldOverride(field, "")
83+
}
84+
return b
8185
}
8286

8387
// WithConditionUpdater must be called if the conditions should be updated, because this requires some additional information.

0 commit comments

Comments
 (0)