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

unknown field "spec.targetRef.namespace" #100

Open
leathersole opened this issue Oct 23, 2024 · 2 comments
Open

unknown field "spec.targetRef.namespace" #100

leathersole opened this issue Oct 23, 2024 · 2 comments

Comments

@leathersole
Copy link

leathersole commented Oct 23, 2024

$ kuadrantctl version
kuadrantctl v0.3.0 (eec318b2e11e7ea5add5e550ff872bde64555d8f)

$ kuadrantctl generate kuadrant ratelimitpolicy --oas https://raw.githubusercontent.com/Kuadrant/kuadrantctl/refs/heads/main/examples/oas3/petstore-with-oidc-kuadrant-extensions.yaml

This command generates following yaml but spec.targetRef.namespace is invalid field and causes error.

apiVersion: kuadrant.io/v1beta2
kind: RateLimitPolicy
metadata:
  creationTimestamp: null
  name: petstore
  namespace: petstore
spec:
  targetRef:
    group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: petstore
    namespace: petstore
status: {}
Error from server (BadRequest): error when creating "STDIN": RateLimitPolicy in version "v1beta2" cannot be handled as a RateLimitPolicy: strict decoding error: unknown field "spec.targetRef.namespace"

Same issue occurs when I generate AuthPolicy

$ kuadrantctl generate kuadrant authpolicy --oas https://raw.githubusercontent.com/Kuadrant/kuadrantctl/refs/heads/main/examples/oas3/petstore-with-oidc-kuadrant-extensions.yaml |kubectl apply -f -
Error from server (BadRequest): error when creating "STDIN": AuthPolicy in version "v1beta2" cannot be handled as a AuthPolicy: strict decoding error: unknown field "spec.targetRef.namespace"
@azgabur
Copy link
Contributor

azgabur commented Dec 13, 2024

If I remember well, there was a change to use non-namespaced targetRef instead of the namespaced ones.
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1alpha2.LocalPolicyTargetReference

@azgabur
Copy link
Contributor

azgabur commented Dec 13, 2024

I can take a look on this as part of #101

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

No branches or pull requests

2 participants