Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( IntelMachineResourceSchema = schema.GroupVersionResource{Group: infrastructurev1alpha1.GroupVersion.Group, Version: infrastructurev1alpha1.GroupVersion.Version, Resource: "intelmachines"} MachineResourceSchema = schema.GroupVersionResource{Group: clusterv1.GroupVersion.Group, Version: clusterv1.GroupVersion.Version, Resource: "machines"} )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Register ¶
func (h *Handler) Register(ctx context.Context, nodeGUID string) (*pb.ShellScriptCommand, *pb.ShellScriptCommand, pb.RegisterClusterResponse_Result, error)
Register is called by the CO Agent when registring a new cluster node. It retrieves the IntelMachine and Machine resources, extracts the bootstrap script from the secret, and returns the install and uninstall commands.
Parameters: - ctx: The context for the request. - nodeGUID: The GUID of the node to be registered.
Returns: - installCmd: The command to install the node. - uninstallCmd: The command to uninstall the node. - result: The result of the registration process. - err: Any error encountered during the registration process.
func (*Handler) UpdateStatus ¶
func (h *Handler) UpdateStatus(ctx context.Context, nodeGUID string, status pb.UpdateClusterStatusRequest_Code) (pb.UpdateClusterStatusResponse_ActionRequest, error)
UpdateStatus determines the action that the CO Agent should take next based on its current state. It saves the CO Agent's current state in an annotation on the IntelMachine.
Parameters:
- ctx: The context for the request.
- nodeGUID: The unique identifier of the node.
- status: The status code from the CO Agent.
Returns:
- pb.UpdateClusterStatusResponse_ActionRequest: The action request to be taken based on the status update.
- error: An error if the status update fails.
type SouthboundHandler ¶
type SouthboundHandler interface {
Register(ctx context.Context, nodeGUID string) (*pb.ShellScriptCommand, *pb.ShellScriptCommand, pb.RegisterClusterResponse_Result, error)
UpdateStatus(ctx context.Context, nodeGUID string, status pb.UpdateClusterStatusRequest_Code) (pb.UpdateClusterStatusResponse_ActionRequest, error)
}