Skip to content

Commit 2913b2c

Browse files
committed
test_helpers: add ability to trigger an error on appling operator's status
1 parent 8e6ed1e commit 2913b2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/operator/v1helpers/test_helpers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ func (c *fakeStaticPodOperatorClient) ApplyStaticPodOperatorSpec(ctx context.Con
183183
}
184184

185185
func (c *fakeStaticPodOperatorClient) ApplyStaticPodOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) (err error) {
186+
if c.triggerStatusUpdateError != nil {
187+
operatorStatus := convertStaticPodOperatorStatusApplyConfiguration(applyConfiguration)
188+
if err := c.triggerStatusUpdateError("", operatorStatus); err != nil {
189+
return err
190+
}
191+
}
186192
c.fakeStaticPodOperatorStatus = convertStaticPodOperatorStatusApplyConfiguration(applyConfiguration)
187193
return nil
188194
}

0 commit comments

Comments
 (0)