nodelock

package
v2.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package nodelock handles locking operations on the node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	// contains filtered or unexported fields
}

Lock locks the node once there the join or the init is at a point where there is no turning back and the other operation does not need to continue.

This can be viewed as a state machine with two states: unlocked and locked. There is no way to unlock, so the state changes only once from unlock to locked.

func New

func New(tpm vtpm.TPMOpenFunc) *Lock

New creates a new NodeLock, which is unlocked.

func (*Lock) TryLockOnce

func (l *Lock) TryLockOnce(clusterID []byte) (bool, error)

TryLockOnce tries to lock the node. If the node is already locked, it returns false. If the node is unlocked, it locks it and returns true.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL