-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: leave discovery service later in the reset sequence
Fixes #8057 I went back and forth on the way to fix it exactly, and ended up with a pretty simple version of a fix. The problem was that discovery service was removing the member at the initial phase of reset, which actually still requires KubeSpan to be up: * leaving `etcd` (need to talk to other members) * stopping pods (might need to talk to Kubernetes API with some CNIs) Now leaving discovery service happens way later, when network interactions are no longer required. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
Showing
12 changed files
with
106 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
package runtime | ||
|
||
import ( | ||
"github.com/cosi-project/runtime/pkg/resource" | ||
"github.com/cosi-project/runtime/pkg/resource/meta" | ||
"github.com/cosi-project/runtime/pkg/resource/protobuf" | ||
"github.com/cosi-project/runtime/pkg/resource/typed" | ||
|
||
"github.com/siderolabs/talos/pkg/machinery/proto" | ||
) | ||
|
||
// MachineResetSignalType is type of MachineResetSignal resource. | ||
const MachineResetSignalType = resource.Type("MachineResetSignals.runtime.talos.dev") | ||
|
||
// MachineResetSignalID is singleton MachineResetSignal resource ID. | ||
const MachineResetSignalID = resource.ID("machine") | ||
|
||
// MachineResetSignal resource is created to signal that the machine is going to be reset soon. | ||
// | ||
// This resource is created when all remaining actions are local to the node, and network communication is not required. | ||
type MachineResetSignal = typed.Resource[MachineResetSignalSpec, MachineResetSignalExtension] | ||
|
||
// MachineResetSignalSpec describes the spec of MachineResetSignal. | ||
// | ||
//gotagsrewrite:gen | ||
type MachineResetSignalSpec struct{} | ||
|
||
// NewMachineResetSignal initializes a MachineResetSignal resource. | ||
func NewMachineResetSignal() *MachineResetSignal { | ||
return typed.NewResource[MachineResetSignalSpec, MachineResetSignalExtension]( | ||
resource.NewMetadata(NamespaceName, MachineResetSignalType, MachineResetSignalID, resource.VersionUndefined), | ||
MachineResetSignalSpec{}, | ||
) | ||
} | ||
|
||
// MachineResetSignalExtension is auxiliary resource data for MachineResetSignal. | ||
type MachineResetSignalExtension struct{} | ||
|
||
// ResourceDefinition implements meta.ResourceDefinitionProvider interface. | ||
func (MachineResetSignalExtension) ResourceDefinition() meta.ResourceDefinitionSpec { | ||
return meta.ResourceDefinitionSpec{ | ||
Type: MachineResetSignalType, | ||
Aliases: []resource.Type{}, | ||
DefaultNamespace: NamespaceName, | ||
} | ||
} | ||
|
||
func init() { | ||
proto.RegisterDefaultTypes() | ||
|
||
err := protobuf.RegisterDynamic[MachineResetSignalSpec](MachineResetSignalType, &MachineResetSignal{}) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters