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

kuma-cp crashes with empty top level targetRef #5165

Closed
slonka opened this issue Oct 18, 2022 · 0 comments · Fixed by #5174
Closed

kuma-cp crashes with empty top level targetRef #5165

slonka opened this issue Oct 18, 2022 · 0 comments · Fixed by #5174
Assignees
Labels
area/policies kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@slonka
Copy link
Contributor

slonka commented Oct 18, 2022

What happened?

Steps to reproduce:

  1. start k3d cluster
  2. apply policy (I also installed demo and observability but this shouldn't matter here, contact me if cannot reproduce)
echo 'apiVersion: kuma.io/v1alpha1
kind: MeshTrace
metadata:
  name: trace-all
  namespace: kong-mesh-system
spec:
  default:
    backends:
      - zipkin:
          url: http://jaeger-collector.mesh-observability:9411/api/v2/spans' | kubectl apply -f -

Stack trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x2517c82]

goroutine 1090 [running]:
github.com/kumahq/kuma/api/common/v1alpha1.(*TargetRef).GetKindEnum(...)
        /home/krzysztof.slonka/go/pkg/mod/github.com/kumahq/kuma@v0.0.0-20221017162450-da91c5000546/api/common/v1alpha1/targetref_helper.go:4
github.com/kumahq/kuma/pkg/plugins/policies/matchers.inboundsSelectedByTargetRef(0x0, 0x41865c0?, 0xc001a6d740?)
        /home/krzysztof.slonka/go/pkg/mod/github.com/kumahq/kuma@v0.0.0-20221017162450-da91c5000546/pkg/plugins/policies/matchers/match.go:118 +0x42
github.com/kumahq/kuma/pkg/plugins/policies/matchers.MatchedPolicies({0x2ec7fd9, 0x9}, 0xc0020c3e48, {0xc0020f0120?, 0xc0020f0150?})
@slonka slonka added triage/pending This issue will be looked at on the next triage meeting kind/bug A bug labels Oct 18, 2022
@lahabana lahabana self-assigned this Oct 19, 2022
@lahabana lahabana added triage/accepted The issue was reviewed and is complete enough to start working on it area/policies and removed triage/pending This issue will be looked at on the next triage meeting labels Oct 19, 2022
lahabana added a commit to lahabana/kuma that referenced this issue Oct 19, 2022
- disallow setting name with `kind: Mesh` as it's unclear what it will mean
- disallow setting mesh with all kinds as it's unclear what it will mean too
- disallow using `MeshHTTPRoute` the thing is not even defined
- rewrite validator for targetRef to use the same wording everwhere

Fix kumahq#5165

Signed-off-by: Charly Molter <charly.molter@konghq.com>
lahabana added a commit to lahabana/kuma that referenced this issue Oct 21, 2022
- disallow setting name with `kind: Mesh` as it's unclear what it will mean
- disallow setting mesh with all kinds as it's unclear what it will mean too
- disallow using `MeshHTTPRoute` the thing is not even defined
- rewrite validator for targetRef to use the same wording everwhere

Fix kumahq#5165

Signed-off-by: Charly Molter <charly.molter@konghq.com>
lahabana added a commit to lahabana/kuma that referenced this issue Oct 21, 2022
- disallow setting name with `kind: Mesh` as it's unclear what it will mean
- disallow setting mesh with all kinds as it's unclear what it will mean too
- disallow using `MeshHTTPRoute` the thing is not even defined
- rewrite validator for targetRef to use the same wording everwhere

Fix kumahq#5165

Signed-off-by: Charly Molter <charly.molter@konghq.com>

make targetRef compulsory
lahabana added a commit that referenced this issue Oct 21, 2022
- disallow setting name with `kind: Mesh` as it's unclear what it will mean
- disallow setting mesh with all kinds as it's unclear what it will mean too
- disallow using `MeshHTTPRoute` the thing is not even defined
- rewrite validator for targetRef to use the same wording everwhere

Fix #5165

Signed-off-by: Charly Molter <charly.molter@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/policies kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants