Skip to content

Commit

Permalink
add context to resourceManager functions
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
  • Loading branch information
rohantmp committed Dec 6, 2021
1 parent 69b0c1f commit 01882ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions controllers/lvmcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ type resourceManager interface {
getName() string

// ensureCreated should check the resources managed by this unit
ensureCreated(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
ensureCreated(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error

// ensureDeleted should wait for the resources to be cleaned up
ensureDeleted(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
ensureDeleted(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error

// updateStatus should optionally update the CR's status about the health of the managed resource
// each unit will have updateStatus called induvidually so
// avoid status fields like lastHeartbeatTime and have a
// status that changes only when the operands change.
updateStatus(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
updateStatus(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error
}
6 changes: 3 additions & 3 deletions doc/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ type resourceManager interface {
getName() string
// ensureCreated should check the resources managed by this unit
ensureCreated(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
ensureCreated(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error
// ensureDeleted should wait for the resources to be cleaned up
ensureDeleted(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
ensureDeleted(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error
// updateStatus should optionally update the CR's status about the health of the managed resource
// each unit will have updateStatus called induvidually so
// avoid status fields like lastHeartbeatTime and have a
// status that changes only when the operands change.
updateStatus(*LVMClusterReconciler, lvmv1alpha1.LVMCluster) error
updateStatus(*LVMClusterReconciler, context.Context, lvmv1alpha1.LVMCluster) error
}
```

0 comments on commit 01882ac

Please sign in to comment.