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

fix(meshhttproute): deref pointer to weight or use default 1 #11051

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

lukidzi
Copy link
Contributor

@lukidzi lukidzi commented Aug 6, 2024

Checklist prior to review

Kubebuilder generates OpenAPI spec with defaults; once we don't set it, it is set to the default from the spec. Unfortunately, it doesn't work on Universal, and the value might not be set correctly. Because of this once dereferencing weight, we hit the nil pointer. #6070

Logs

	OnTick() failed	{"dataplaneKey": {"Mesh":"default","Name":"gateway-instance-1"}, "error": "runtime error: invalid memory address or nil pointer dereference", "errorVerbose": "runtime error: invalid memory address or nil pointer dereference\ngithub.com/kumahq/kuma/pkg/util/watchdog.(*SimpleWatchdog).onTick.func1\n\tgithub.com/kumahq/kuma/pkg/util/watchdog/watchdog.go:62\nruntime.gopanic\n\truntime/panic.go:770\nruntime.panicmem\n\truntime/panic.go:261\nruntime.sigpanic\n\truntime/signal_unix.go:881\ngithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1.makeHttpRouteEntry\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/gateway_routes.go:220\ngithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1.generateEnvoyRouteEntries\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/gateway_routes.go:180\ngithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1.sortRulesToHosts\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/gateway_routes.go:147\ngithub.com/kumahq/kuma/pkg/plugins/policies/core/xds/meshroute.CollectListenerInfos\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/core/xds/meshroute/gateway.go:100\ngithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1.ApplyToGateway\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin.go:126\ngithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1.plugin.Apply\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin.go:62\ngithub.com/kumahq/kuma/pkg/plugins/policies/core/generator.generator.Generate\n\tgithub.com/kumahq/kuma/pkg/plugins/policies/core/generator/generator.go:23\ngithub.com/kumahq/kuma/pkg/xds/generator/core.CompositeResourceGenerator.Generate\n\tgithub.com/kumahq/kuma/pkg/xds/generator/core/resource_generator.go:22\ngithub.com/kumahq/kuma/pkg/xds/generator.(*ProxyTemplateProfileSource).Generate\n\tgithub.com/kumahq/kuma/pkg/xds/generator/proxy_template.go:76\ngithub.com/kumahq/kuma/pkg/xds/generator.(*ProxyTemplateGenerator).Generate\n\tgithub.com/kumahq/kuma/pkg/xds/generator/proxy_template.go:28\ngithub.com/kumahq/kuma/pkg/xds/server/v3.(*TemplateSnapshotGenerator).GenerateSnapshot\n\tgithub.com/kumahq/kuma/pkg/xds/server/v3/reconcile.go:167\ngithub.com/kumahq/kuma/pkg/xds/server/v3.(*reconciler).Reconcile\n\tgithub.com/kumahq/kuma/pkg/xds/server/v3/reconcile.go:55\ngithub.com/kumahq/kuma/pkg/xds/sync.(*DataplaneWatchdog).syncDataplane\n\tgithub.com/kumahq/kuma/pkg/xds/sync/dataplane_watchdog.go:166\ngithub.com/kumahq/kuma/pkg/xds/sync.(*DataplaneWatchdog).Sync\n\tgithub.com/kumahq/kuma/pkg/xds/sync/dataplane_watchdog.go:80\ngithub.com/kumahq/kuma/pkg/xds/sync.(*dataplaneWatchdogFactory).New.func2\n\tgithub.com/kumahq/kuma/pkg/xds/sync/dataplane_watchdog_factory.go:43\ngithub.com/kumahq/kuma/pkg/util/watchdog.(*SimpleWatchdog).onTick\n\tgithub.com/kumahq/kuma/pkg/util/watchdog/watchdog.go:70\ngithub.com/kumahq/kuma/pkg/util/watchdog.(*SimpleWatchdog).Start\n\tgithub.com/kumahq/kuma/pkg/util/watchdog/watchdog.go:40\nruntime.goexit\n\truntime/asm_arm64.s:1222"}
  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
    • Don't forget ci/ labels to run additional/fewer tests
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label) --

@lukidzi lukidzi requested a review from a team as a code owner August 6, 2024 12:40
@lukidzi lukidzi requested review from lobkovilya and Icarus9913 and removed request for a team August 6, 2024 12:40
@lukidzi lukidzi merged commit 36db2c9 into kumahq:master Aug 6, 2024
15 checks passed
Copy link
Contributor

github-actions bot commented Aug 19, 2024

backporting to release-2.5 with action

backporting to release-2.6 with action
backporting to release-2.4 with action
backporting to release-2.7 with action
backporting to release-2.8 with action

kumahq bot pushed a commit that referenced this pull request Aug 19, 2024
kumahq bot pushed a commit that referenced this pull request Aug 19, 2024
kumahq bot pushed a commit that referenced this pull request Aug 19, 2024
kumahq bot pushed a commit that referenced this pull request Aug 19, 2024
kumahq bot pushed a commit that referenced this pull request Aug 19, 2024
lukidzi added a commit that referenced this pull request Aug 19, 2024
…t of #11051) (#11130)

fix(meshhttproute): deref pointer to weight or use default 1 (#11051)

Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
lukidzi added a commit that referenced this pull request Aug 19, 2024
…t of #11051) (#11129)

fix(meshhttproute): deref pointer to weight or use default 1 (#11051)

Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
lukidzi added a commit that referenced this pull request Aug 19, 2024
…t of #11051) (#11127)

fix(meshhttproute): deref pointer to weight or use default 1 (#11051)

Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants