kyma-project / api-gateway

Apache License 2.0
4 stars 27 forks source link

Error watching Ory Rules #1047

Closed kolodziejczak closed 4 months ago

kolodziejczak commented 4 months ago

Description

image

Expected result

Error logs are no longer appearing

Actual result

Error logs appear, logging an issue with listing Ory Rules

Steps to reproduce

Run test-integration-gateway Makefile target, which will run Gateway integration tests suite

Troubleshooting

PR

barchw commented 4 months ago

Reproduce by:

  1. Install API Gateway module, create API Gateway CR, wait for it to be Ready
  2. Create a Ory based API Rule (e.g. OAuth2 intro):
    apiVersion: gateway.kyma-project.io/v1beta1
    kind: APIRule
    metadata:
    name: s
    namespace: sidecar-enabled2
    spec:
    gateway: kyma-system/kyma-gateway
    host: httpbin2
    service:
    name: httpbin
    port: 8000
    rules:
    - path: /.*
      methods: ["GET","POST"]
      mutators: []
      accessStrategies:
        - handler: oauth2_introspection
  3. Delete apirule
  4. Delete APIGateway CR (uninstall module)
  5. API Gateway controller will throw the error

The error is an issue with controller runtime setting a watch on Rules when creating one.

barchw commented 4 months ago

An upstream issue exists for this: https://github.com/kubernetes-sigs/controller-runtime/issues/2723