Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Should not filter GatewayClass by Namespace #1424

Closed
stillfox-lee opened this issue Nov 1, 2022 · 3 comments · Fixed by #1440
Closed

bug: Should not filter GatewayClass by Namespace #1424

stillfox-lee opened this issue Nov 1, 2022 · 3 comments · Fixed by #1440
Labels
area/controller triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@stillfox-lee
Copy link
Contributor

Issue description

create GatewayClass resource like:

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
  namespace: ingress-apisix-e2e-tests-default-624859000
  name: test-gateway-class
spec:
  controllerName: apisix.apache.org/gateway-controller

GatewayClass Status still be "Waiting for controller":

❯ kubectl get gatewayclass -n ingress-apisix-e2e-tests-default-624859000 -o yaml
apiVersion: v1
items:
- apiVersion: gateway.networking.k8s.io/v1alpha2
  kind: GatewayClass
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"gateway.networking.k8s.io/v1alpha2","kind":"GatewayClass","metadata":{"annotations":{},"name":"test-gateway-class"},"spec":{"controllerName":"apisix.apache.org/gateway-controller"}}
    creationTimestamp: "2022-11-01T07:23:37Z"
    generation: 1
    name: test-gateway-class
    resourceVersion: "5288"
    uid: 4eec3b01-632b-46c3-9376-5e0864d486cd
  spec:
    controllerName: apisix.apache.org/gateway-controller
  status:
    conditions:
    - lastTransitionTime: "1970-01-01T00:00:00Z"
      message: Waiting for controller
      reason: Waiting
      status: Unknown
      type: Accepted
kind: List
metadata:
  resourceVersion: ""

As we can see, Namespace field didn't show in the Gatewayclass resource. But event handler

if !c.controller.NamespaceProvider.IsWatchingNamespace(key) {
return
}
will check namespace.
May be we should just use controllerName to filter GatewayClass resource.

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long): master branch
  • your Kubernetes cluster version (output of kubectl version): v1.21.1
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a): kind

Minimal test code / Steps to reproduce

like description

Actual result

no

Error log

no

Expected result

GatewayClass Status should be updated.

@tao12345666333
Copy link
Member

Yes
GatewayClass is cluster scoped

@stillfox-lee
Copy link
Contributor Author

This issue was discovered when I setup e2e-test for route attachment feature. Can I fix this issue with the same PR ?(route attachment)

@tao12345666333
Copy link
Member

Sure! Please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants