kubernetes: [v1.27.1] panic when creating GameServerAllocation in Agones (works in v1.26.4)
What happened:
Following the example here: https://agones.dev/site/docs/getting-started/create-fleet/ https://github.com/googleforgames/agones/tree/main/examples/simple-game-server
Everything here works when you use kubectl v1.26.4, but when using 1.27.1, I see the following panic:
❯ kubectl get gs
NAME STATE ADDRESS PORT NODE AGE
simple-game-server-r2k6f-jg64f Ready 34.127.80.88 7797 gke-test-cluster-default-220f0e35-bm6g 8s
simple-game-server-r2k6f-x8dkb Ready 34.127.80.88 7866 gke-test-cluster-default-220f0e35-bm6g 8s
agones/examples/simple-game-server on docs/allocated-overflow via 🐹 v1.19.8 on ☁️ quilkin-mark-dev on ☸ gke_agones-mark-dev_us-west1_test-cluster
❯ kubectl create -f ./gameserverallocation.yaml -o yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1576d6a]
goroutine 1 [running]:
k8s.io/cli-runtime/pkg/resource.supportsQueryParamV3(0x7f5ed2c721b8?, {{0xc001d87128, 0x15}, {0xc001d8713e, 0x2}, {0xc001d87140, 0x14}}, {0x1f1b8ee, 0xf})
vendor/k8s.io/cli-runtime/pkg/resource/query_param_verifier_v3.go:109 +0x6a
k8s.io/cli-runtime/pkg/resource.(*queryParamVerifierV3).HasSupport(0xc001e2d290, {{0xc001d87128, 0x15}, {0xc001d8713e, 0x2}, {0xc001d87140, 0x14}})
vendor/k8s.io/cli-runtime/pkg/resource/query_param_verifier_v3.go:65 +0x4cf
k8s.io/cli-runtime/pkg/resource.(*fallbackQueryParamVerifier).HasSupport(0xc001e48d40, {{0xc001d87128, 0x15}, {0xc001d8713e, 0x2}, {0xc001d87140, 0x14}})
vendor/k8s.io/cli-runtime/pkg/resource/fallback_query_param_verifier.go:50 +0x6d
k8s.io/kubectl/pkg/validation.(*paramVerifyingSchema).ValidateBytes(0xc001e2d2f0, {0xc0016c9040, 0x98, 0xa0})
vendor/k8s.io/kubectl/pkg/validation/schema.go:139 +0x135
k8s.io/cli-runtime/pkg/resource.ValidateSchema({0xc0016c9040?, 0x1e61880?, 0xc001e2d620?}, {0x7f5ed2c212a8?, 0xc001e2d2f0?})
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:234 +0x42
k8s.io/cli-runtime/pkg/resource.(*StreamVisitor).Visit(0xc001de2f80, 0xc001e16d38)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:577 +0x14b
k8s.io/cli-runtime/pkg/resource.(*FileVisitor).Visit(0xc001e16ca8, 0xc0001fb968?)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:536 +0x2c5
k8s.io/cli-runtime/pkg/resource.EagerVisitorList.Visit({0xc001e07110, 0x1, 0x1d25260?}, 0xc001de3040)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:213 +0xff
k8s.io/cli-runtime/pkg/resource.FlattenListVisitor.Visit({{0x238bb20, 0xc001e16cc0}, {0x23932a8, 0x3337b28}, 0xc001e2d530}, 0xc001de3000)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:396 +0xc2
k8s.io/cli-runtime/pkg/resource.FlattenListVisitor.Visit({{0x238bb60, 0xc001e2d560}, {0x23932a8, 0x3337b28}, 0xc001e2d530}, 0xc001e16d08)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:396 +0xc2
k8s.io/cli-runtime/pkg/resource.ContinueOnErrorVisitor.Visit({{0x238bb60?, 0xc001e2d5c0?}}, 0xc001de2fc0)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:359 +0xdb
k8s.io/cli-runtime/pkg/resource.DecoratedVisitor.Visit({{0x238bae0, 0xc001e07130}, {0xc001e49d00, 0x3, 0x4}}, 0xc001e49d20)
vendor/k8s.io/cli-runtime/pkg/resource/visitor.go:331 +0xc7
k8s.io/cli-runtime/pkg/resource.(*Result).Visit(0xc001e0b700, 0x0?)
vendor/k8s.io/cli-runtime/pkg/resource/result.go:99 +0x4b
k8s.io/kubectl/pkg/cmd/create.(*CreateOptions).RunCreate(0xc00063e620, {0x23ae2a0, 0xc00015df00}, 0xc000252c00)
vendor/k8s.io/kubectl/pkg/cmd/create/create.go:266 +0x2ad
k8s.io/kubectl/pkg/cmd/create.NewCmdCreate.func1(0xc000252c00?, {0xc0000d86c0?, 0x0?, 0x4?})
vendor/k8s.io/kubectl/pkg/cmd/create/create.go:119 +0x185
github.com/spf13/cobra.(*Command).execute(0xc000252c00, {0xc0000d8680, 0x4, 0x4})
vendor/github.com/spf13/cobra/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc000252000)
vendor/github.com/spf13/cobra/command.go:1040 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
vendor/github.com/spf13/cobra/command.go:968
k8s.io/component-base/cli.run(0xc000252000)
vendor/k8s.io/component-base/cli/run.go:146 +0x317
k8s.io/component-base/cli.RunNoErrOutput(...)
vendor/k8s.io/component-base/cli/run.go:84
main.main()
cmd/kubectl/kubectl.go:30 +0x1e
agones/examples/simple-game-server on docs/allocated-overflow via 🐹 v1.19.8 on ☁️ quilkin-mark-dev on ☸ gke_agones-mark-dev_us-west1_test-cluster
❯ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.1", GitCommit:"4c9411232e10168d7b050c49a1b59f6df9d7ea4b", GitTreeState:"clean", BuildDate:"2023-04-14T13:21:19Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.7-gke.1000", GitCommit:"0a719a43f6f42e7e4cc9f696a5a6a416da0b229e", GitTreeState:"clean", BuildDate:"2023-03-14T10:47:42Z", GoVersion:"go1.19.6 X:boringcrypto", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.27) and server (1.25) exceeds the supported minor version skew of +/-1
What you expected to happen:
When downgrading, this works as expected:
agones/examples/simple-game-server on docs/allocated-overflow via 🐹 v1.19.8 on ☁️ quilkin-mark-dev on ☸ gke_agones-mark-dev_us-west1_test-cluster
❯ /tmp/kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.4", GitCommit:"f89670c3aa4059d6999cb42e23ccb4f0b9a03979", GitTreeState:"clean", BuildDate:"2023-04-12T12:13:53Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.7-gke.1000", GitCommit:"0a719a43f6f42e7e4cc9f696a5a6a416da0b229e", GitTreeState:"clean", BuildDate:"2023-03-14T10:47:42Z", GoVersion:"go1.19.6 X:boringcrypto", Compiler:"gc", Platform:"linux/amd64"}
agones/examples/simple-game-server on docs/allocated-overflow via 🐹 v1.19.8 on ☁️ quilkin-mark-dev on ☸ gke_agones-mark-dev_us-west1_test-cluster
❯ /tmp/kubectl create -f ./gameserverallocation.yaml -o yaml
apiVersion: allocation.agones.dev/v1
kind: GameServerAllocation
metadata:
creationTimestamp: "2023-05-03T16:18:16Z"
name: simple-game-server-r2k6f-jg64f
namespace: default
spec:
metadata: {}
multiClusterSetting:
policySelector: {}
required: {}
scheduling: Packed
selectors:
- gameServerState: Ready
matchLabels:
agones.dev/fleet: simple-game-server
players: {}
status:
address: 34.127.80.88
gameServerName: simple-game-server-r2k6f-jg64f
nodeName: gke-test-cluster-default-220f0e35-bm6g
ports:
- name: default
port: 7797
source: local
state: Allocated
How to reproduce it (as minimally and precisely as possible):
You will need a Kubernetes cluster with Agones installed (I’m testing on 1.25.x, as you can see above), then follow this quickstart: https://agones.dev/site/docs/getting-started/create-fleet/
Anything else we need to know?:
The GameServerAllocation is implemented as an API Extension, not a CRD – which is probably where the issue lies.
Looking at the line:
https://github.com/kubernetes/cli-runtime/blob/v0.27.1/pkg/resource/query_param_verifier_v3.go#L109
There seems to be an assuming that there will be a Path under doc and Path, indoc.Paths.Path - there should be some nil checks in there.
Environment:
- Kubernetes client and server versions (use
kubectl version): See above - Cloud provider or hardware configuration: GKE
- OS (e.g:
cat /etc/os-release): Linux
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (15 by maintainers)
If nothing else, this does also force me to publish an openapi spec for our API extension 😄