Skip to content

Commit

Permalink
Only disable 'excotic' features on NotFound/NoAccess errors
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
  • Loading branch information
mikkeloscar committed Apr 7, 2022
1 parent 66bba09 commit 59f7b5b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions kubernetes/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,11 @@ func (a *Adapter) ListResources() ([]*Ingress, error) {
if a.routeGroupSupport {
rgs, err = a.ListRoutegroups()
if err != nil {
a.routeGroupSupport = false
log.Warnf("Disabling RouteGroup support because listing RouteGroups failed: %v, to get more information https://opensource.zalando.com/skipper/kubernetes/routegroups/#routegroups", err)
// Generic error, RouteGroup CRD exists and we have permission to access
if err != ErrResourceNotFound && err != ErrNoPermissionToAccessResource {
if errors.Is(err, ErrResourceNotFound) || errors.Is(err, ErrNoPermissionToAccessResource) {
a.routeGroupSupport = false
log.Warnf("Disabling RouteGroup support because listing RouteGroups failed: %v, to get more information https://opensource.zalando.com/skipper/kubernetes/routegroups/#routegroups", err)
} else {
// Generic error, RouteGroup CRD exists and we have permission to access
return nil, err
}
}
Expand All @@ -330,10 +331,11 @@ func (a *Adapter) ListResources() ([]*Ingress, error) {
if a.fabricSupport {
fgs, err = a.ListFabricgateways()
if err != nil {
a.fabricSupport = false
log.Warnf("Disabling FabricGateway support because listing FabricGateways failed: %v, to get more information https://opensource.zalando.com/skipper/kubernetes/fabric/#fabricgateways", err)
// Generic error, FabricGateway CRD exists and we have permission to access
if err != ErrResourceNotFound && err != ErrNoPermissionToAccessResource {
if errors.Is(err, ErrResourceNotFound) || errors.Is(err, ErrNoPermissionToAccessResource) {
a.fabricSupport = false
log.Warnf("Disabling FabricGateway support because listing FabricGateways failed: %v, to get more information https://opensource.zalando.com/skipper/kubernetes/fabric/#fabricgateways", err)
} else {
// Generic error, FabricGateway CRD exists and we have permission to access
return nil, err
}
}
Expand Down

0 comments on commit 59f7b5b

Please sign in to comment.