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

Fixed Stop() for external etcd #4327

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

makhov
Copy link
Contributor

@makhov makhov commented Apr 23, 2024

Description

Don't try to stop etcd in case the external one is used.
Currently, it panics:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xa8 pc=0x23053fc]

goroutine 1 [running]:
github.com/k0sproject/k0s/pkg/supervisor.(*Supervisor).Stop(0x4001257280)
        /go/src/github.com/k0sproject/k0s/pkg/supervisor/supervisor.go:237 +0x20c
github.com/k0sproject/k0s/pkg/component/controller.(*Etcd).Stop(0x400014ac80?)
        /go/src/github.com/k0sproject/k0s/pkg/component/controller/etcd.go:233 +0x24
github.com/k0sproject/k0s/pkg/component/manager.(*Manager).Stop(0x40013e3d40)
        /go/src/github.com/k0sproject/k0s/pkg/component/manager/manager.go:118 +0xe4
github.com/k0sproject/k0s/cmd/controller.(*command).start.func1()
        /go/src/github.com/k0sproject/k0s/cmd/controller/controller.go:302 +0x24
github.com/k0sproject/k0s/cmd/controller.(*command).start(0x400160f770, {0x3b2fd80, 0x40013e3d00})
        /go/src/github.com/k0sproject/k0s/cmd/controller/controller.go:502 +0x3774
github.com/k0sproject/k0s/cmd/controller.NewControllerCmd.func2(0x4000ed2600, {0x400042b2c0, 0x0, 0x2?})
        /go/src/github.com/k0sproject/k0s/cmd/controller/controller.go:114 +0x3a0
github.com/spf13/cobra.(*Command).execute(0x4000ed2600, {0x400042b2a0, 0x2, 0x2})
        /run/k0s-build/go/mod/github.com/spf13/[email protected]/command.go:940 +0x5c4
github.com/spf13/cobra.(*Command).ExecuteC(0x4000c37500)
        /run/k0s-build/go/mod/github.com/spf13/[email protected]/command.go:1068 +0x340
github.com/spf13/cobra.(*Command).Execute(...)
        /run/k0s-build/go/mod/github.com/spf13/[email protected]/command.go:992
github.com/k0sproject/k0s/cmd.Execute()
        /go/src/github.com/k0sproject/k0s/cmd/root.go:194 +0x20
main.main()
        /go/src/github.com/k0sproject/k0s/main.go:43 +0x238

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist:

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@makhov makhov requested a review from a team as a code owner April 23, 2024 07:28
@makhov makhov requested review from ncopa and juanluisvaladas April 23, 2024 07:29
@twz123 twz123 added bug Something isn't working component/etcd backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch labels Apr 23, 2024
@makhov makhov added backport/release-1.27 PR that needs to be backported/cherrypicked to release-1.27 branch backport/release-1.28 PR that needs to be backported/cherrypicked to release-1.28 branch labels Apr 23, 2024
@makhov makhov merged commit 8b89fe7 into k0sproject:main Apr 23, 2024
80 checks passed
@k0s-bot
Copy link

k0s-bot commented Apr 23, 2024

Successfully created backport PR for release-1.27:

@k0s-bot
Copy link

k0s-bot commented Apr 23, 2024

Successfully created backport PR for release-1.28:

@k0s-bot
Copy link

k0s-bot commented Apr 23, 2024

Successfully created backport PR for release-1.29:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/release-1.27 PR that needs to be backported/cherrypicked to release-1.27 branch backport/release-1.28 PR that needs to be backported/cherrypicked to release-1.28 branch backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch bug Something isn't working component/etcd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants