Skip to content

Commit d668b8c

Browse files
committed
add decoration watch
1 parent 59f8004 commit d668b8c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

xset/api/xset_controller_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ type SubResourcePvcAdapter interface {
102102
// X target when creating, (3) manage decoration update when decoration changed.
103103
type DecorationAdapter interface {
104104
// WatchDecoration allows controller to watch decoration change.
105-
WatchDecoration(c *controller.Controller)
105+
WatchDecoration(c *controller.Controller) error
106106
// GetDecorationGroupVersionKind returns decoration gvk.
107107
GetDecorationGroupVersionKind() metav1.GroupVersionKind
108108
// GetDecorationPatcherFromTarget returns patcher for decoration from target.

xset/xset_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ func SetUpWithManager(mgr ctrl.Manager, xsetController api.XSetController) error
148148

149149
// watch for decoration changed
150150
if adapter, ok := xsetController.(api.DecorationAdapter); ok {
151-
adapter.WatchDecoration(&c)
151+
err = adapter.WatchDecoration(&c)
152+
if err != nil {
153+
return err
154+
}
152155
}
153156

154157
return nil

0 commit comments

Comments
 (0)