Skip to content

Commit

Permalink
Fail when ApiServerSource adapter can't retrieve resources (#355)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Co-authored-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
openshift-cherrypick-robot and pierDipi authored Sep 22, 2023
1 parent 95dfb61 commit 155f6e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/adapter/apiserver/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package apiserver

import (
"context"
"fmt"
"net/http"
"time"

Expand Down Expand Up @@ -88,8 +89,7 @@ func (a *apiServerAdapter) start(ctx context.Context, stopCh <-chan struct{}) er

resources, err := a.discover.ServerResourcesForGroupVersion(configRes.GVR.GroupVersion().String())
if err != nil {
a.logger.Errorf("Could not retrieve information about resource %s: %s", configRes.GVR.String(), err.Error())
continue
return fmt.Errorf("failed to retrieve information about resource %s: %v", configRes.GVR.String(), err)
}

exists := false
Expand Down Expand Up @@ -120,7 +120,7 @@ func (a *apiServerAdapter) start(ctx context.Context, stopCh <-chan struct{}) er
}

if !exists {
a.logger.Errorf("Could not retrieve information about resource %s: %s", configRes.GVR.String())
a.logger.Errorf("could not retrieve information about resource %s: it doesn't exist", configRes.GVR.String())
}
}

Expand Down

0 comments on commit 155f6e4

Please sign in to comment.