» cat httproute.yaml
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: app
spec:
parentRefs:
- name: default
namespace: envoy-gateway-system
hostnames:
- test-auth.ihwa.liao.dev
rules:
- matches:
- path:
type: PathPrefix
value: /
headers:
- name: authorization
type: RegularExpression
value: "Bearer .*"
backendRefs:
- name: web-app
port: 80
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: auth-app
port: 80
» ~/third_party/envoyproxy-gateway/default/egctl x translate --from gateway-api --to xds --type route --add-missing-resources --file httproute.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1dabd3a]
goroutine 1 [running]:
github.com/envoyproxy/gateway/internal/cmd/egctl.addDefaultEnvoyProxy(0xc0007bdc80)
github.com/envoyproxy/gateway/internal/cmd/egctl/translate.go:812 +0x1a
github.com/envoyproxy/gateway/internal/cmd/egctl.kubernetesYAMLToResources({0xc00083e500, 0x271}, 0x1)
github.com/envoyproxy/gateway/internal/cmd/egctl/translate.go:801 +0x2334
github.com/envoyproxy/gateway/internal/cmd/egctl.translate({0x2750d40, 0xc0000b6030}, {0x7ffd4703fb68, 0xe}, {0x7ffd4703fb27, 0xb}, {0xc00037a270, 0x1, 0x1}, {0x24518dc, ...}, ...)
github.com/envoyproxy/gateway/internal/cmd/egctl/translate.go:224 +0x159
github.com/envoyproxy/gateway/internal/cmd/egctl.NewTranslateCommand.func1(0xc0001ae400?, {0x2451af0?, 0x4?, 0x2451904?})
github.com/envoyproxy/gateway/internal/cmd/egctl/translate.go:97 +0x14e
github.com/spf13/cobra.(*Command).execute(0xc000836300, {0xc0002158c0, 0x9, 0x9})
github.com/spf13/cobra@v1.7.0/command.go:940 +0x87c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0007c3800)
github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5
github.com/spf13/cobra.(*Command).Execute(0x0?)
github.com/spf13/cobra@v1.7.0/command.go:992 +0x13
main.main()
github.com/envoyproxy/gateway/cmd/egctl/main.go:16 +0x18
Description:
egctl x translatepanics when only given an httproute resource.Repro steps:
Just httproute
httproute + gatewayclass
httproute + gateway + gatewayclass
Environment:
egctl built from current HEAD: e171678