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

Custom Entities: attempting to use an unsupported king in KongCustomEntity's parentRef e.g. KongService yields Programmed=true incorrectly #6787

Closed
1 task
pmalek opened this issue Dec 5, 2024 · 1 comment · Fixed by #6791
Assignees
Milestone

Comments

@pmalek
Copy link
Member

pmalek commented Dec 5, 2024

Problem statement

Following guide in https://docs.konghq.com/kubernetes-ingress-controller/3.3.x/guides/services/custom-entity/ but attempting to use a different (unsupported) parentRef.kind e.g. KongService results in KongCustomEntity to get a Programmed=true status condition being set.

At the same time Gateway spews out the following error in logs:

2024/12/05 18:52:57 [error] 2540#0: *6 [kong] plugins_iterator.lua:639 failed to execute plugin 'degraphql:configure (./degraphql/handler.lua:80: attempt to index field 'service' (a nil value)), context: ngx.timer
2024/12/05 18:52:57 [error] 2540#0: *6 [lua] callback.lua:91: do_handlerlist(): worker-events: event callback failed; source=declarative, event=reconfigure, wid=1 error='./degraphql/handler.lua:80: attempt to index field 'service' (a nil value)
stack traceback:
       ./degraphql/handler.lua:80: in function 'update_router'
       ./degraphql/handler.lua:176: in function <./degraphql/handler.lua:175>
       [C]: in function 'xpcall'
       /usr/local/openresty/site/lualib/resty/events/callback.lua:77: in function 'do_handlerlist'
       /usr/local/openresty/site/lualib/resty/events/callback.lua:122: in function 'do_event'
       /usr/local/openresty/site/lualib/resty/events/worker.lua:230: in function </usr/local/openresty/site/lualib/resty/events/worker.lua:217>', data=["0dc6f45b-8f8d-40d2-a504-473544ee190b"], context: ngx.timer

Related issue(s)

#6629

How to reproduce

Apply the following manifest

apiVersion: configuration.konghq.com/v1alpha1
kind: KongCustomEntity
metadata:
  namespace: default
  name: degraphql-route-example
spec:
  type: degraphql_routes
  fields:
    uri: /contacts
    query: "query{ contacts { name } }"
  controllerName: kong
  parentRef:
    group: configuration.konghq.com
    kind: KongService
    name: degraphql-example

and observe the following status on the entity being set:

status:
  conditions:
  - lastTransitionTime: "2024-12-05T18:52:57Z"
    message: Object was successfully configured in Kong.
    observedGeneration: 1
    reason: Programmed
    status: "True"
    type: Programmed

Acceptance criteria

  • As a user, when applying KongCustomEntity with invalid config, I expect the status conditions to reflect that and do not populate status condition with type Programmed to have status set to true.
@pmalek pmalek added this to the KIC v3.4.x milestone Dec 5, 2024
@pmalek pmalek self-assigned this Dec 6, 2024
@pmalek
Copy link
Member Author

pmalek commented Dec 6, 2024

spec.parentRef.kind validation has been done in Kong/kubernetes-configuration#180.

Status conditions are fixed in #6791 when the referenced parentRef doesn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant