gitlab-shell tcpExternalConfig=true causes operator CrashLoop (SIGSEGV)
Summary
When deploying a GitLab instance with gitlab.gitlab-shell.tcpExternalConfig set to true, the operator will keep crashing trying to reconcile the GitLab Shell configuration.
Steps to reproduce
Create a GitLab CRD deployment with gitlab.gitlab-shell.tcpExternalConfig=true and wait for the operator to pick it up and instantiate it.
Configuration used
# operator-values.yaml
# Prefer using the chart name over the hard-coded default
nameOverride: ""
helm upgrade --install gitlab-operator gitlab-operator/gitlab-operator \
--version 0.9.1 \
--namespace gitlab-system \
--create-namespace \
--values operator-values.yaml
Current behavior
Operator enters a crash loop (SIGSEGV).
Expected behavior
Operator applies the configuration without any complications but most of all; doesn't completely hard crash itself preventing it from doing anything at all.
Versions
- Operator: 0.9.1
- Platform:
- Self-hosted: kubeadm
- Kubernetes:
- Client:
version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"archive", BuildDate:"2022-06-18T07:33:51Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"} - Server:
version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:15:38Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
- Client:
Relevant logs
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x137f8c2]
goroutine 329 [running]:
sigs.k8s.io/controller-runtime/pkg/client.ObjectKeyFromObject(0x0, 0x0, 0x49, 0xc00124c320, 0x2, 0x2)
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/client/interfaces.go:35 +0x22
gitlab.com/gitlab-org/cloud-native/gitlab-operator/controllers.(*GitLabReconciler).createOrPatch(0xc0007d7540, 0x22bfc08, 0xc003aafbf0, 0x0, 0x0, 0x22dcac8, 0xc00297acf0, 0xc002839101, 0x0, 0x0)
/workspace/controllers/gitlab_controller.go:559 +0x5f
gitlab.com/gitlab-org/cloud-native/gitlab-operator/controllers.(*GitLabReconciler).reconcileShellConfigMaps(0xc0007d7540, 0x22bfc08, 0xc003aafbf0, 0x22dcac8, 0xc00297acf0, 0x22da108, 0xc0021031a0, 0x0, 0x1)
/workspace/controllers/gitlab_shell.go:44 +0xe5
gitlab.com/gitlab-org/cloud-native/gitlab-operator/controllers.(*GitLabReconciler).reconcileGitLabShell(0xc0007d7540, 0x22bfc08, 0xc003aafbf0, 0x22dcac8, 0xc00297acf0, 0x22da108, 0xc0021031a0, 0x1, 0x0)
/workspace/controllers/gitlab_shell.go:11 +0x71
gitlab.com/gitlab-org/cloud-native/gitlab-operator/controllers.(*GitLabReconciler).Reconcile(0xc0007d7540, 0x22bfc08, 0xc003aafbf0, 0xc0006b2f30, 0xd, 0xc0006b2f14, 0x6, 0xc003aafbf0, 0xc003aafb60, 0xc004fcfdb0, ...)
/workspace/controllers/gitlab_controller.go:213 +0x2145
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0xc000784960, 0x22bfc08, 0xc003aafb60, 0xc0006b2f30, 0xd, 0xc0006b2f14, 0x6, 0xc003aafb00, 0x0, 0x0, ...)
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/internal/controller/controller.go:114 +0x247
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000784960, 0x22bfb60, 0xc0006e2ec0, 0x1dfef80, 0xc0043b8780)
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/internal/controller/controller.go:311 +0x305
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000784960, 0x22bfb60, 0xc0006e2ec0, 0xc0001a2f00)
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/internal/controller/controller.go:266 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2(0xc000f2e120, 0xc000784960, 0x22bfb60, 0xc0006e2ec0)
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/internal/controller/controller.go:227 +0x6b
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.1/pkg/internal/controller/controller.go:223 +0x425