Skip to content

Commit

Permalink
SQUASH: Allow raw source
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
  • Loading branch information
sttts committed Apr 24, 2024
1 parent ca692b1 commit 6db0f6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/builder/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,19 +355,19 @@ func (blder *Builder) doWatch() error {
if len(blder.watchesInput) == 0 && blder.forInput.object == nil && len(blder.rawSources) == 0 {
return errors.New("there are no watches configured, controller will never get triggered. Use For(), Owns(), Watches() or WatchesRawSource() to set them up")
}
if *blder.ctrlOptions.EngageWithProviderClusters && len(blder.rawSources) > 0 {
return errors.New("when using a cluster adapter, custom raw watches are not allowed")
if !*blder.ctrlOptions.EngageWithDefaultCluster && len(blder.rawSources) > 0 {
return errors.New("when using a cluster adapter without watching the default cluster, non-cluster-aware custom raw watches are not allowed")
}

if *blder.ctrlOptions.EngageWithDefaultCluster {
if err := blder.Watch(unboundedContext, blder.mgr); err != nil {
return err
}
}

for _, src := range blder.rawSources {
if err := blder.ctrl.Watch(src); err != nil {
return err
for _, src := range blder.rawSources {
if err := blder.ctrl.Watch(src); err != nil {
return err
}
}
}
return nil
Expand Down

0 comments on commit 6db0f6f

Please sign in to comment.