Documentation
¶
Index ¶
- Constants
- func ShouldEvacuateNode(machine *Machine) bool
- type Client
- func (cl *Client) AllowMachineDrain(ctx context.Context, recorder record.EventRecorder, machine *Machine) error
- func (cl *Client) AllowMachineTermination(ctx context.Context, recorder record.EventRecorder, machine *Machine) error
- func (cl *Client) GetMachineForNode(ctx context.Context, node *corev1.Node) (*Machine, error)
- func (cl *Client) MachineEventf(recorder record.EventRecorder, machine *Machine, ...)
- func (cl *Client) PreventMachineDeletion(ctx context.Context, machine *Machine) error
- type Machine
Constants ¶
const ( SatelliteAllowedToBeDrainedEvent = "SatelliteAllowedToBeDrained" SatelliteAllowedToBeRemovedEvent = "SatelliteAllowedToBeRemoved" )
Variables ¶
This section is empty.
Functions ¶
func ShouldEvacuateNode ¶
ShouldEvacuateNode returns true if the machine is being deleted
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AllowMachineDrain ¶
func (cl *Client) AllowMachineDrain(ctx context.Context, recorder record.EventRecorder, machine *Machine) error
AllowMachineDrain removes the annotation that prevents draining the Node.
func (*Client) AllowMachineTermination ¶
func (cl *Client) AllowMachineTermination(ctx context.Context, recorder record.EventRecorder, machine *Machine) error
AllowMachineTermination removes the annotation that prevents removal of the Node.
func (*Client) GetMachineForNode ¶
GetMachineForNode tries to get the Machine that controls the Node. Returns "nil, nil" if: * ClusterAPI is not deployed in this cluster * the Node is not managed by ClusterAPI * the Machine could not be found
func (*Client) MachineEventf ¶ added in v2.10.2
func (cl *Client) MachineEventf(recorder record.EventRecorder, machine *Machine, eventtype, reason, messageFmt string, args ...interface{})
MachineEventf records an event for the Machine. The default scheme used by record.EventRecorder does not recognize a Machine, so we manually convert it to a reference first.
func (*Client) PreventMachineDeletion ¶
PreventMachineDeletion sets hooks that prevent ClusterAPI from terminating the node and thus the Satellite. The hooks are only set when the Machine is not already in the process of being deleted.
type Machine ¶
type Machine = clusterapiv1beta1.Machine