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 .spec.image nil pointer #178

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

kobzonega
Copy link
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

nil pointer when keep .spec.Image is empty field

2024/01/31 11:56:15 http: panic serving [2a02:6b8:c08:b58d:0:1517:2:ec]:60364: runtime error: invalid memory address or nil pointer dereference goroutine 49187 [running]: net/http.(*conn).serve.func1() /usr/local/go/src/net/http/server.go:1850 +0xbf panic({0x1991240, 0x2d46090}) /usr/local/go/src/runtime/panic.go:890 +0x262 github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1.(*StorageDefaulter).Default(0xc000d51f20?, {0x24?, 0xc0009f9998?}, {0x1f044e0?, 0xc0004deb00}) /workspace/api/v1alpha1/storage_webhook.go:80 +0x16b sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*defaulterForType).Handle(_, {_, _}, {{{0xc000d51f20, 0x24}, {{0xc0009f9998, 0x8}, {0xc0009f99c0, 0x8}, {0xc0009f99c8, ...}}, ...}}) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.1/pkg/webhook/admission/defaulter_custom.go:84 +0x2fd sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).Handle(_, {_, _}, {{{0xc000d51f20, 0x24}, {{0xc0009f9998, 0x8}, {0xc0009f99c0, 0x8}, {0xc0009f99c8, ...}}, ...}}) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.1/pkg/webhook/admission/webhook.go:169 +0xfd sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP(0xc000ab1000, {0x7f69652b3bc0?, 0xc0008157c0}, 0xc0009f7400) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.1/pkg/webhook/admission/http.go:98 +0xed2 github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0x7f69652b3bc0, 0xc0008157c0}, 0x1f16300?) /go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/promhttp/instrument_server.go:60 +0xd4 net/http.HandlerFunc.ServeHTTP(0x1f163f0?, {0x7f69652b3bc0?, 0xc0008157c0?}, 0x7ba3e0?) /usr/local/go/src/net/http/server.go:2109 +0x2f github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x1f163f0?, 0xc000826e00?}, 0xc0009f7400) /go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/promhttp/instrument_server.go:146 +0xb8 net/http.HandlerFunc.ServeHTTP(0x0?, {0x1f163f0?, 0xc000826e00?}, 0xc000d51e60?) /usr/local/go/src/net/http/server.go:2109 +0x2f github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x1f163f0, 0xc000826e00}, 0xc0009f7400) /go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/promhttp/instrument_server.go:108 +0xbf net/http.HandlerFunc.ServeHTTP(0xc000826e00?, {0x1f163f0?, 0xc000826e00?}, 0x1c4ecef?) /usr/local/go/src/net/http/server.go:2109 +0x2f net/http.(*ServeMux).ServeHTTP(0xc000c8d8a7?, {0x1f163f0, 0xc000826e00}, 0xc0009f7400) /usr/local/go/src/net/http/server.go:2487 +0x149 net/http.serverHandler.ServeHTTP({0x1f08360?}, {0x1f163f0, 0xc000826e00}, 0xc0009f7400) /usr/local/go/src/net/http/server.go:2947 +0x30c net/http.(*conn).serve(0xc0006adcc0, {0x1f175b0, 0xc000599b30}) /usr/local/go/src/net/http/server.go:1991 +0x607 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:3102 +0x4db

What is the new behavior?

  • fix nil pointer
  • bump version

Other information

generate manifests from previous changes

@kobzonega kobzonega self-assigned this Feb 8, 2024
@kobzonega kobzonega merged commit 2e7e7b7 into ydb-platform:master Feb 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants